libmsv
Monkeysphere Validation library
Loading...
Searching...
No Matches
Data Structures | Macros | Typedefs | Functions
msv.h File Reference

main public libmsv header file More...

#include <unistd.h>

Go to the source code of this file.

Data Structures

struct  msv_query
 a query to the MSVA More...
 
struct  msv_response
 a response from the MSVA More...
 

Macros

#define LIBMSV_ERROR_SUCCESS   0
 Success or absence of error.
 
#define LIBMSV_ERROR_INVALID   1
 Use of certificate could not be determined valid or was determined invalid.
 
#define LIBMSV_ERROR_NOENVVAR   2
 Environment variable was needed but was not set.
 
#define LIBMSV_ERROR_CURLINIT_FAILED   3
 curl_easy_init() failed for unknown reason
 
#define LIBMSV_ERROR_CURLCODE   4
 an unspecified curl function failed
 
#define LIBMSV_ERROR_INCOMPATIBLE_AGENT   5
 MSVA was perceived as incompatible.
 
#define LIBMSV_ERROR_BADARG   6
 An argument to the function was invalid.
 
#define LIBMSV_ERROR_UNEXPECTED_RESPONSE   7
 The response from MSVA was unexpected.
 
#define LIBMSV_ERROR_NOMEM   8
 necessary memory allocation failed
 
#define MSV_DEPRECATED(X)   X
 

Typedefs

typedef struct msv_ctxt * msv_ctxt_t
 opaque MSVA context
 

Functions

msv_ctxt_t msv_ctxt_init (const char *url)
 Return an MSV context.
 
void msv_ctxt_destroy (msv_ctxt_t ctx)
 Destroy an MSV context.
 
const char * msv_strerror (msv_ctxt_t ctx, int error_code)
 Return string describing libmsv error code.
 
int msv_check_msva (msv_ctxt_t ctx)
 Check suitability of Monkeysphere Validation Agent.
 
int msv_query_agent (msv_ctxt_t ctx, struct msv_query q, struct msv_response **response_ptr)
 Query validation agent for certificate validity.
 
void msv_response_destroy (struct msv_response *response)
 Destroy an MSV response.
 

Detailed Description

main public libmsv header file

Macro Definition Documentation

◆ LIBMSV_ERROR_CURLCODE

#define LIBMSV_ERROR_CURLCODE   4

an unspecified curl function failed

The MSV context retains the curl error code for the last operation run within that context

Function Documentation

◆ msv_check_msva()

int msv_check_msva ( msv_ctxt_t  ctx)
extern

Check suitability of Monkeysphere Validation Agent.

Parameters
ctxthe MSV context
Returns
0 for success, or libmsv error code

◆ msv_ctxt_destroy()

void msv_ctxt_destroy ( msv_ctxt_t  ctx)
extern

Destroy an MSV context.

Parameters
ctxthe MSV context to destroy

◆ msv_ctxt_init()

msv_ctxt_t msv_ctxt_init ( const char *  url)
extern

Return an MSV context.

Parameters
urlURL for MSVA or NULL to use MONKEYSPHERE_VALIDATION_AGENT_SOCKET environment variable
Returns
MSV context

◆ msv_query_agent()

int msv_query_agent ( msv_ctxt_t  ctx,
struct msv_query  q,
struct msv_response **  response_ptr 
)
extern

Query validation agent for certificate validity.

Parameters
ctxthe MSV context
qmsv_query struct representing the MSVA query
response_ptrpointer to pointer to msv_response struct that the caller is responsible for destroying via msv_response_destroy
Returns
0 for valid use of certificate, 1 for invalid use of certificate, or libmsv error code

◆ msv_response_destroy()

void msv_response_destroy ( struct msv_response response)
extern

Destroy an MSV response.

Parameters
responsethe MSV response to destroy

◆ msv_strerror()

const char * msv_strerror ( msv_ctxt_t  ctx,
int  error_code 
)
extern

Return string describing libmsv error code.

Parameters
ctxthe relevant MSV context
error_codereturn value of libmsv function
Returns
string describing error