1 .TH "hx509 verification functions" 3 "11 Jan 2012" "Version 1.5.2" "Heimdalx509library" \" -*- nroff -*-
5 hx509 verification functions \-
10 .RI "void \fBhx509_context_set_missing_revoke\fP (hx509_context context, int flag)"
13 .RI "int \fBhx509_verify_init_ctx\fP (hx509_context context, hx509_verify_ctx *ctx)"
16 .RI "void \fBhx509_verify_destroy_ctx\fP (hx509_verify_ctx ctx)"
19 .RI "void \fBhx509_verify_attach_anchors\fP (hx509_verify_ctx ctx, hx509_certs set)"
22 .RI "void \fBhx509_verify_attach_revoke\fP (hx509_verify_ctx ctx, hx509_revoke_ctx revoke_ctx)"
25 .RI "void \fBhx509_verify_set_time\fP (hx509_verify_ctx ctx, time_t t)"
28 .RI "void \fBhx509_verify_set_max_depth\fP (hx509_verify_ctx ctx, unsigned int max_depth)"
31 .RI "void \fBhx509_verify_set_proxy_certificate\fP (hx509_verify_ctx ctx, int boolean)"
34 .RI "void \fBhx509_verify_set_strict_rfc3280_verification\fP (hx509_verify_ctx ctx, int boolean)"
37 .RI "int \fBhx509_verify_path\fP (hx509_context context, hx509_verify_ctx ctx, hx509_cert cert, hx509_certs pool)"
40 .RI "int \fBhx509_ocsp_verify\fP (hx509_context context, time_t now, hx509_cert cert, int flags, const void *data, size_t length, time_t *expiration)"
43 .RI "int \fBhx509_crl_alloc\fP (hx509_context context, hx509_crl *crl)"
46 .RI "int \fBhx509_crl_add_revoked_certs\fP (hx509_context context, hx509_crl crl, hx509_certs certs)"
49 .RI "int \fBhx509_crl_lifetime\fP (hx509_context context, hx509_crl crl, int delta)"
52 .RI "void \fBhx509_crl_free\fP (hx509_context context, hx509_crl *crl)"
55 .RI "int \fBhx509_crl_sign\fP (hx509_context context, hx509_cert signer, hx509_crl crl, heim_octet_string *os)"
58 .SH "Detailed Description"
61 .SH "Function Documentation"
63 .SS "void hx509_context_set_missing_revoke (hx509_context context, int flag)"
65 Selects if the \fBhx509_revoke_verify()\fP function is going to require the existans of a revokation method (OCSP, CRL) or not. Note that \fBhx509_verify_path()\fP, \fBhx509_cms_verify_signed()\fP, and other function call \fBhx509_revoke_verify()\fP.
69 \fIcontext\fP hx509 context to change the flag for.
71 \fIflag\fP zero, revokation method required, non zero missing revokation method ok
75 .SS "int hx509_crl_add_revoked_certs (hx509_context context, hx509_crl crl, hx509_certs certs)"
77 Add revoked certificate to an CRL context.
81 \fIcontext\fP a hx509 context.
83 \fIcrl\fP the CRL to add the revoked certificate to.
85 \fIcerts\fP keyset of certificate to revoke.
90 An hx509 error code, see \fBhx509_get_error_string()\fP.
94 .SS "int hx509_crl_alloc (hx509_context context, hx509_crl * crl)"
96 Create a CRL context. Use \fBhx509_crl_free()\fP to free the CRL context.
100 \fIcontext\fP a hx509 context.
102 \fIcrl\fP return pointer to a newly allocated CRL context.
107 An hx509 error code, see \fBhx509_get_error_string()\fP.
111 .SS "void hx509_crl_free (hx509_context context, hx509_crl * crl)"
117 \fIcontext\fP a hx509 context.
119 \fIcrl\fP a CRL context to free.
123 .SS "int hx509_crl_lifetime (hx509_context context, hx509_crl crl, int delta)"
125 Set the lifetime of a CRL context.
129 \fIcontext\fP a hx509 context.
131 \fIcrl\fP a CRL context
133 \fIdelta\fP delta time the certificate is valid, library adds the current time to this.
138 An hx509 error code, see \fBhx509_get_error_string()\fP.
142 .SS "int hx509_crl_sign (hx509_context context, hx509_cert signer, hx509_crl crl, heim_octet_string * os)"
144 Sign a CRL and return an encode certificate.
148 \fIcontext\fP a hx509 context.
150 \fIsigner\fP certificate to sign the CRL with
152 \fIcrl\fP the CRL to sign
154 \fIos\fP return the signed and encoded CRL, free with free_heim_octet_string()
159 An hx509 error code, see \fBhx509_get_error_string()\fP.
163 .SS "int hx509_ocsp_verify (hx509_context context, time_t now, hx509_cert cert, int flags, const void * data, size_t length, time_t * expiration)"
165 Verify that the certificate is part of the OCSP reply and it's not expired. Doesn't verify signature the OCSP reply or it's done by a authorized sender, that is assumed to be already done.
169 \fIcontext\fP a hx509 context
171 \fInow\fP the time right now, if 0, use the current time.
173 \fIcert\fP the certificate to verify
175 \fIflags\fP flags control the behavior
177 \fIdata\fP pointer to the encode ocsp reply
179 \fIlength\fP the length of the encode ocsp reply
181 \fIexpiration\fP return the time the OCSP will expire and need to be rechecked.
186 An hx509 error code, see \fBhx509_get_error_string()\fP.
190 .SS "void hx509_verify_attach_anchors (hx509_verify_ctx ctx, hx509_certs set)"
192 Set the trust anchors in the verification context, makes an reference to the keyset, so the consumer can free the keyset independent of the destruction of the verification context (ctx). If there already is a keyset attached, it's released.
196 \fIctx\fP a verification context
198 \fIset\fP a keyset containing the trust anchors.
202 .SS "void hx509_verify_attach_revoke (hx509_verify_ctx ctx, hx509_revoke_ctx revoke_ctx)"
204 Attach an revocation context to the verfication context, , makes an reference to the revoke context, so the consumer can free the revoke context independent of the destruction of the verification context. If there is no revoke context, the verification process is NOT going to check any verification status.
208 \fIctx\fP a verification context.
210 \fIrevoke_ctx\fP a revoke context.
214 .SS "void hx509_verify_destroy_ctx (hx509_verify_ctx ctx)"
216 Free an hx509 verification context.
220 \fIctx\fP the context to be freed.
224 .SS "int hx509_verify_init_ctx (hx509_context context, hx509_verify_ctx * ctx)"
226 Allocate an verification context that is used fo control the verification process.
230 \fIcontext\fP A hx509 context.
232 \fIctx\fP returns a pointer to a hx509_verify_ctx object.
237 An hx509 error code, see \fBhx509_get_error_string()\fP.
241 .SS "int hx509_verify_path (hx509_context context, hx509_verify_ctx ctx, hx509_cert cert, hx509_certs pool)"
243 Build and verify the path for the certificate to the trust anchor specified in the verify context. The path is constructed from the certificate, the pool and the trust anchors.
247 \fIcontext\fP A hx509 context.
249 \fIctx\fP A hx509 verification context.
251 \fIcert\fP the certificate to build the path from.
253 \fIpool\fP A keyset of certificates to build the chain from.
258 An hx509 error code, see \fBhx509_get_error_string()\fP.
262 .SS "void hx509_verify_set_max_depth (hx509_verify_ctx ctx, unsigned int max_depth)"
264 Set the maximum depth of the certificate chain that the path builder is going to try.
268 \fIctx\fP a verification context
270 \fImax_depth\fP maxium depth of the certificate chain, include trust anchor.
274 .SS "void hx509_verify_set_proxy_certificate (hx509_verify_ctx ctx, int boolean)"
276 Allow or deny the use of proxy certificates
280 \fIctx\fP a verification context
282 \fIboolean\fP if non zero, allow proxy certificates.
286 .SS "void hx509_verify_set_strict_rfc3280_verification (hx509_verify_ctx ctx, int boolean)"
288 Select strict RFC3280 verification of certificiates. This means checking key usage on CA certificates, this will make version 1 certificiates unuseable.
292 \fIctx\fP a verification context
294 \fIboolean\fP if non zero, use strict verification.
298 .SS "void hx509_verify_set_time (hx509_verify_ctx ctx, time_t t)"
300 Set the clock time the the verification process is going to use. Used to check certificate in the past and future time. If not set the current time will be used.
304 \fIctx\fP a verification context.
306 \fIt\fP the time the verifiation is using.