libmsv
Monkeysphere Validation library
msv.h
Go to the documentation of this file.
1 #ifndef _MSV_H
2 #define _MSV_H 1
3 
4 #include <unistd.h>
5 
14 #define LIBMSV_ERROR_SUCCESS 0
15 
19 #define LIBMSV_ERROR_INVALID 1
20 
24 #define LIBMSV_ERROR_NOENVVAR 2
25 
29 #define LIBMSV_ERROR_CURLINIT_FAILED 3
30 
37 #define LIBMSV_ERROR_CURLCODE 4
38 
42 #define LIBMSV_ERROR_INCOMPATIBLE_AGENT 5
43 
47 #define LIBMSV_ERROR_BADARG 6
48 
53 #define LIBMSV_ERROR_UNEXPECTED_RESPONSE 7
54 
59 #define LIBMSV_ERROR_NOMEM 8
60 
65 struct msv_ctxt;
66 typedef struct msv_ctxt *msv_ctxt_t;
67 
72 struct msv_query
73 {
74  const char *context;
75  const char *peertype;
76  const char *peername;
77  const char *pkctype;
78  const char *pkcdata;
79 };
80 
81 #ifdef HAVE_VAR_ATTRIBUTE_DEPRECATED
82 # define MSV_DEPRECATED(X) X __attribute__((deprecated))
83 #elif __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5)
84 # define MSV_DEPRECATED(X) X __attribute__((deprecated))
85 #elif __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)
86 # define MSV_DEPRECATED(X) X __attribute__((__deprecated__))
87 #else
88 # define MSV_DEPRECATED(X) X
89 #endif
90 
96 {
97  int valid;
98  char *message;
99  size_t MSV_DEPRECATED(sz);
100 };
101 
108 extern msv_ctxt_t msv_ctxt_init (const char *url);
109 
115 extern void msv_ctxt_destroy (msv_ctxt_t ctx);
116 
124 extern const char *msv_strerror (msv_ctxt_t ctx, int error_code);
125 
132 extern int msv_check_msva (msv_ctxt_t ctx);
133 
143 extern int msv_query_agent (msv_ctxt_t ctx, struct msv_query q,
144  struct msv_response **response_ptr);
145 
151 extern void msv_response_destroy (struct msv_response *response);
152 
153 #endif /* _MSV_H */
const char * pkctype
Definition: msv.h:77
char * message
Definition: msv.h:98
const char * msv_strerror(msv_ctxt_t ctx, int error_code)
Return string describing libmsv error code.
a response from the MSVA
Definition: msv.h:95
int valid
Definition: msv.h:97
void msv_response_destroy(struct msv_response *response)
Destroy an MSV response.
const char * context
Definition: msv.h:74
const char * pkcdata
Definition: msv.h:78
struct msv_ctxt * msv_ctxt_t
opaque MSVA context
Definition: msv.h:66
void msv_ctxt_destroy(msv_ctxt_t ctx)
Destroy an MSV context.
int msv_query_agent(msv_ctxt_t ctx, struct msv_query q, struct msv_response **response_ptr)
Query validation agent for certificate validity.
const char * peertype
Definition: msv.h:75
int msv_check_msva(msv_ctxt_t ctx)
Check suitability of Monkeysphere Validation Agent.
const char * peername
Definition: msv.h:76
msv_ctxt_t msv_ctxt_init(const char *url)
Return an MSV context.
a query to the MSVA
Definition: msv.h:72