]> CyberLeo.Net >> Repos - FreeBSD/releng/10.2.git/blob - crypto/heimdal/doc/doxyout/hx509/man/man3/hx509_cert.3
- Copy stable/10@285827 to releng/10.2 in preparation for 10.2-RC1
[FreeBSD/releng/10.2.git] / crypto / heimdal / doc / doxyout / hx509 / man / man3 / hx509_cert.3
1 .TH "hx509 certificate functions" 3 "11 Jan 2012" "Version 1.5.2" "Heimdalx509library" \" -*- nroff -*-
2 .ad l
3 .nh
4 .SH NAME
5 hx509 certificate functions \- 
6 .SS "Functions"
7
8 .in +1c
9 .ti -1c
10 .RI "int \fBhx509_cert_init\fP (hx509_context context, const Certificate *c, hx509_cert *cert)"
11 .br
12 .ti -1c
13 .RI "int \fBhx509_cert_init_data\fP (hx509_context context, const void *ptr, size_t len, hx509_cert *cert)"
14 .br
15 .ti -1c
16 .RI "void \fBhx509_cert_free\fP (hx509_cert cert)"
17 .br
18 .ti -1c
19 .RI "hx509_cert \fBhx509_cert_ref\fP (hx509_cert cert)"
20 .br
21 .ti -1c
22 .RI "void \fBhx509_verify_ctx_f_allow_default_trustanchors\fP (hx509_verify_ctx ctx, int boolean)"
23 .br
24 .ti -1c
25 .RI "int \fBhx509_cert_find_subjectAltName_otherName\fP (hx509_context context, hx509_cert cert, const heim_oid *oid, hx509_octet_string_list *list)"
26 .br
27 .ti -1c
28 .RI "int \fBhx509_cert_cmp\fP (hx509_cert p, hx509_cert q)"
29 .br
30 .ti -1c
31 .RI "int \fBhx509_cert_get_issuer\fP (hx509_cert p, hx509_name *name)"
32 .br
33 .ti -1c
34 .RI "int \fBhx509_cert_get_subject\fP (hx509_cert p, hx509_name *name)"
35 .br
36 .ti -1c
37 .RI "int \fBhx509_cert_get_base_subject\fP (hx509_context context, hx509_cert c, hx509_name *name)"
38 .br
39 .ti -1c
40 .RI "int \fBhx509_cert_get_serialnumber\fP (hx509_cert p, heim_integer *i)"
41 .br
42 .ti -1c
43 .RI "time_t \fBhx509_cert_get_notBefore\fP (hx509_cert p)"
44 .br
45 .ti -1c
46 .RI "time_t \fBhx509_cert_get_notAfter\fP (hx509_cert p)"
47 .br
48 .ti -1c
49 .RI "int \fBhx509_cert_get_SPKI\fP (hx509_context context, hx509_cert p, SubjectPublicKeyInfo *spki)"
50 .br
51 .ti -1c
52 .RI "int \fBhx509_cert_get_SPKI_AlgorithmIdentifier\fP (hx509_context context, hx509_cert p, AlgorithmIdentifier *alg)"
53 .br
54 .ti -1c
55 .RI "int \fBhx509_cert_get_issuer_unique_id\fP (hx509_context context, hx509_cert p, heim_bit_string *issuer)"
56 .br
57 .ti -1c
58 .RI "int \fBhx509_cert_get_subject_unique_id\fP (hx509_context context, hx509_cert p, heim_bit_string *subject)"
59 .br
60 .ti -1c
61 .RI "int \fBhx509_verify_hostname\fP (hx509_context context, const hx509_cert cert, int flags, hx509_hostname_type type, const char *hostname, const struct sockaddr *sa, int sa_size)"
62 .br
63 .ti -1c
64 .RI "hx509_cert_attribute \fBhx509_cert_get_attribute\fP (hx509_cert cert, const heim_oid *oid)"
65 .br
66 .ti -1c
67 .RI "int \fBhx509_cert_set_friendly_name\fP (hx509_cert cert, const char *name)"
68 .br
69 .ti -1c
70 .RI "const char * \fBhx509_cert_get_friendly_name\fP (hx509_cert cert)"
71 .br
72 .ti -1c
73 .RI "int \fBhx509_query_alloc\fP (hx509_context context, hx509_query **q)"
74 .br
75 .ti -1c
76 .RI "void \fBhx509_query_match_option\fP (hx509_query *q, hx509_query_option option)"
77 .br
78 .ti -1c
79 .RI "int \fBhx509_query_match_issuer_serial\fP (hx509_query *q, const Name *issuer, const heim_integer *serialNumber)"
80 .br
81 .ti -1c
82 .RI "int \fBhx509_query_match_friendly_name\fP (hx509_query *q, const char *name)"
83 .br
84 .ti -1c
85 .RI "int \fBhx509_query_match_eku\fP (hx509_query *q, const heim_oid *eku)"
86 .br
87 .ti -1c
88 .RI "int \fBhx509_query_match_cmp_func\fP (hx509_query *q, int(*func)(hx509_context, hx509_cert, void *), void *ctx)"
89 .br
90 .ti -1c
91 .RI "void \fBhx509_query_free\fP (hx509_context context, hx509_query *q)"
92 .br
93 .ti -1c
94 .RI "void \fBhx509_query_statistic_file\fP (hx509_context context, const char *fn)"
95 .br
96 .ti -1c
97 .RI "void \fBhx509_query_unparse_stats\fP (hx509_context context, int printtype, FILE *out)"
98 .br
99 .ti -1c
100 .RI "int \fBhx509_cert_check_eku\fP (hx509_context context, hx509_cert cert, const heim_oid *eku, int allow_any_eku)"
101 .br
102 .ti -1c
103 .RI "int \fBhx509_cert_binary\fP (hx509_context context, hx509_cert c, heim_octet_string *os)"
104 .br
105 .ti -1c
106 .RI "int \fBhx509_print_cert\fP (hx509_context context, hx509_cert cert, FILE *out)"
107 .br
108 .in -1c
109 .SH "Detailed Description"
110 .PP 
111 See the \fBThe basic certificate\fP for description and examples. 
112 .SH "Function Documentation"
113 .PP 
114 .SS "int hx509_cert_binary (hx509_context context, hx509_cert c, heim_octet_string * os)"
115 .PP
116 Encodes the hx509 certificate as a DER encode binary.
117 .PP
118 \fBParameters:\fP
119 .RS 4
120 \fIcontext\fP A hx509 context. 
121 .br
122 \fIc\fP the certificate to encode. 
123 .br
124 \fIos\fP the encode certificate, set to NULL, 0 on case of error. Free the os->data with \fBhx509_xfree()\fP.
125 .RE
126 .PP
127 \fBReturns:\fP
128 .RS 4
129 An hx509 error code, see \fBhx509_get_error_string()\fP. 
130 .RE
131 .PP
132
133 .SS "int hx509_cert_check_eku (hx509_context context, hx509_cert cert, const heim_oid * eku, int allow_any_eku)"
134 .PP
135 Check the extended key usage on the hx509 certificate.
136 .PP
137 \fBParameters:\fP
138 .RS 4
139 \fIcontext\fP A hx509 context. 
140 .br
141 \fIcert\fP A hx509 context. 
142 .br
143 \fIeku\fP the EKU to check for 
144 .br
145 \fIallow_any_eku\fP if the any EKU is set, allow that to be a substitute.
146 .RE
147 .PP
148 \fBReturns:\fP
149 .RS 4
150 An hx509 error code, see \fBhx509_get_error_string()\fP. 
151 .RE
152 .PP
153
154 .SS "int hx509_cert_cmp (hx509_cert p, hx509_cert q)"
155 .PP
156 Compare to hx509 certificate object, useful for sorting.
157 .PP
158 \fBParameters:\fP
159 .RS 4
160 \fIp\fP a hx509 certificate object. 
161 .br
162 \fIq\fP a hx509 certificate object.
163 .RE
164 .PP
165 \fBReturns:\fP
166 .RS 4
167 0 the objects are the same, returns > 0 is p is 'larger' then q, < 0 if p is 'smaller' then q. 
168 .RE
169 .PP
170
171 .SS "int hx509_cert_find_subjectAltName_otherName (hx509_context context, hx509_cert cert, const heim_oid * oid, hx509_octet_string_list * list)"
172 .PP
173 Return a list of subjectAltNames specified by oid in the certificate. On error the
174 .PP
175 The returned list of octet string should be freed with \fBhx509_free_octet_string_list()\fP.
176 .PP
177 \fBParameters:\fP
178 .RS 4
179 \fIcontext\fP A hx509 context. 
180 .br
181 \fIcert\fP a hx509 certificate object. 
182 .br
183 \fIoid\fP an oid to for SubjectAltName. 
184 .br
185 \fIlist\fP list of matching SubjectAltName.
186 .RE
187 .PP
188 \fBReturns:\fP
189 .RS 4
190 An hx509 error code, see \fBhx509_get_error_string()\fP. 
191 .RE
192 .PP
193
194 .SS "void hx509_cert_free (hx509_cert cert)"
195 .PP
196 Free reference to the hx509 certificate object, if the refcounter reaches 0, the object if freed. Its allowed to pass in NULL.
197 .PP
198 \fBParameters:\fP
199 .RS 4
200 \fIcert\fP the cert to free. 
201 .RE
202 .PP
203
204 .SS "hx509_cert_attribute hx509_cert_get_attribute (hx509_cert cert, const heim_oid * oid)"
205 .PP
206 Get an external attribute for the certificate, examples are friendly name and id.
207 .PP
208 \fBParameters:\fP
209 .RS 4
210 \fIcert\fP hx509 certificate object to search 
211 .br
212 \fIoid\fP an oid to search for.
213 .RE
214 .PP
215 \fBReturns:\fP
216 .RS 4
217 an hx509_cert_attribute, only valid as long as the certificate is referenced. 
218 .RE
219 .PP
220
221 .SS "int hx509_cert_get_base_subject (hx509_context context, hx509_cert c, hx509_name * name)"
222 .PP
223 Return the name of the base subject of the hx509 certificate. If the certiicate is a verified proxy certificate, the this function return the base certificate (root of the proxy chain). If the proxy certificate is not verified with the base certificate HX509_PROXY_CERTIFICATE_NOT_CANONICALIZED is returned.
224 .PP
225 \fBParameters:\fP
226 .RS 4
227 \fIcontext\fP a hx509 context. 
228 .br
229 \fIc\fP a hx509 certificate object. 
230 .br
231 \fIname\fP a pointer to a hx509 name, should be freed by \fBhx509_name_free()\fP. See also \fBhx509_cert_get_subject()\fP.
232 .RE
233 .PP
234 \fBReturns:\fP
235 .RS 4
236 An hx509 error code, see \fBhx509_get_error_string()\fP. 
237 .RE
238 .PP
239
240 .SS "const char* hx509_cert_get_friendly_name (hx509_cert cert)"
241 .PP
242 Get friendly name of the certificate.
243 .PP
244 \fBParameters:\fP
245 .RS 4
246 \fIcert\fP cert to get the friendly name from.
247 .RE
248 .PP
249 \fBReturns:\fP
250 .RS 4
251 an friendly name or NULL if there is. The friendly name is only valid as long as the certificate is referenced. 
252 .RE
253 .PP
254
255 .SS "int hx509_cert_get_issuer (hx509_cert p, hx509_name * name)"
256 .PP
257 Return the name of the issuer of the hx509 certificate.
258 .PP
259 \fBParameters:\fP
260 .RS 4
261 \fIp\fP a hx509 certificate object. 
262 .br
263 \fIname\fP a pointer to a hx509 name, should be freed by \fBhx509_name_free()\fP.
264 .RE
265 .PP
266 \fBReturns:\fP
267 .RS 4
268 An hx509 error code, see \fBhx509_get_error_string()\fP. 
269 .RE
270 .PP
271
272 .SS "int hx509_cert_get_issuer_unique_id (hx509_context context, hx509_cert p, heim_bit_string * issuer)"
273 .PP
274 Get a copy of the Issuer Unique ID
275 .PP
276 \fBParameters:\fP
277 .RS 4
278 \fIcontext\fP a hx509_context 
279 .br
280 \fIp\fP a hx509 certificate 
281 .br
282 \fIissuer\fP the issuer id returned, free with der_free_bit_string()
283 .RE
284 .PP
285 \fBReturns:\fP
286 .RS 4
287 An hx509 error code, see \fBhx509_get_error_string()\fP. The error code HX509_EXTENSION_NOT_FOUND is returned if the certificate doesn't have a issuerUniqueID 
288 .RE
289 .PP
290
291 .SS "time_t hx509_cert_get_notAfter (hx509_cert p)"
292 .PP
293 Get notAfter time of the certificate.
294 .PP
295 \fBParameters:\fP
296 .RS 4
297 \fIp\fP a hx509 certificate object.
298 .RE
299 .PP
300 \fBReturns:\fP
301 .RS 4
302 return not after time. 
303 .RE
304 .PP
305
306 .SS "time_t hx509_cert_get_notBefore (hx509_cert p)"
307 .PP
308 Get notBefore time of the certificate.
309 .PP
310 \fBParameters:\fP
311 .RS 4
312 \fIp\fP a hx509 certificate object.
313 .RE
314 .PP
315 \fBReturns:\fP
316 .RS 4
317 return not before time 
318 .RE
319 .PP
320
321 .SS "int hx509_cert_get_serialnumber (hx509_cert p, heim_integer * i)"
322 .PP
323 Get serial number of the certificate.
324 .PP
325 \fBParameters:\fP
326 .RS 4
327 \fIp\fP a hx509 certificate object. 
328 .br
329 \fIi\fP serial number, should be freed ith der_free_heim_integer().
330 .RE
331 .PP
332 \fBReturns:\fP
333 .RS 4
334 An hx509 error code, see \fBhx509_get_error_string()\fP. 
335 .RE
336 .PP
337
338 .SS "int hx509_cert_get_SPKI (hx509_context context, hx509_cert p, SubjectPublicKeyInfo * spki)"
339 .PP
340 Get the SubjectPublicKeyInfo structure from the hx509 certificate.
341 .PP
342 \fBParameters:\fP
343 .RS 4
344 \fIcontext\fP a hx509 context. 
345 .br
346 \fIp\fP a hx509 certificate object. 
347 .br
348 \fIspki\fP SubjectPublicKeyInfo, should be freed with free_SubjectPublicKeyInfo().
349 .RE
350 .PP
351 \fBReturns:\fP
352 .RS 4
353 An hx509 error code, see \fBhx509_get_error_string()\fP. 
354 .RE
355 .PP
356
357 .SS "int hx509_cert_get_SPKI_AlgorithmIdentifier (hx509_context context, hx509_cert p, AlgorithmIdentifier * alg)"
358 .PP
359 Get the AlgorithmIdentifier from the hx509 certificate.
360 .PP
361 \fBParameters:\fP
362 .RS 4
363 \fIcontext\fP a hx509 context. 
364 .br
365 \fIp\fP a hx509 certificate object. 
366 .br
367 \fIalg\fP AlgorithmIdentifier, should be freed with free_AlgorithmIdentifier(). The algorithmidentifier is typicly rsaEncryption, or id-ecPublicKey, or some other public key mechanism.
368 .RE
369 .PP
370 \fBReturns:\fP
371 .RS 4
372 An hx509 error code, see \fBhx509_get_error_string()\fP. 
373 .RE
374 .PP
375
376 .SS "int hx509_cert_get_subject (hx509_cert p, hx509_name * name)"
377 .PP
378 Return the name of the subject of the hx509 certificate.
379 .PP
380 \fBParameters:\fP
381 .RS 4
382 \fIp\fP a hx509 certificate object. 
383 .br
384 \fIname\fP a pointer to a hx509 name, should be freed by \fBhx509_name_free()\fP. See also \fBhx509_cert_get_base_subject()\fP.
385 .RE
386 .PP
387 \fBReturns:\fP
388 .RS 4
389 An hx509 error code, see \fBhx509_get_error_string()\fP. 
390 .RE
391 .PP
392
393 .SS "int hx509_cert_get_subject_unique_id (hx509_context context, hx509_cert p, heim_bit_string * subject)"
394 .PP
395 Get a copy of the Subect Unique ID
396 .PP
397 \fBParameters:\fP
398 .RS 4
399 \fIcontext\fP a hx509_context 
400 .br
401 \fIp\fP a hx509 certificate 
402 .br
403 \fIsubject\fP the subject id returned, free with der_free_bit_string()
404 .RE
405 .PP
406 \fBReturns:\fP
407 .RS 4
408 An hx509 error code, see \fBhx509_get_error_string()\fP. The error code HX509_EXTENSION_NOT_FOUND is returned if the certificate doesn't have a subjectUniqueID 
409 .RE
410 .PP
411
412 .SS "int hx509_cert_init (hx509_context context, const Certificate * c, hx509_cert * cert)"
413 .PP
414 Allocate and init an hx509 certificate object from the decoded certificate `c´.
415 .PP
416 \fBParameters:\fP
417 .RS 4
418 \fIcontext\fP A hx509 context. 
419 .br
420 \fIc\fP 
421 .br
422 \fIcert\fP 
423 .RE
424 .PP
425 \fBReturns:\fP
426 .RS 4
427 Returns an hx509 error code. 
428 .RE
429 .PP
430
431 .SS "int hx509_cert_init_data (hx509_context context, const void * ptr, size_t len, hx509_cert * cert)"
432 .PP
433 Just like \fBhx509_cert_init()\fP, but instead of a decode certificate takes an pointer and length to a memory region that contains a DER/BER encoded certificate.
434 .PP
435 If the memory region doesn't contain just the certificate and nothing more the function will fail with HX509_EXTRA_DATA_AFTER_STRUCTURE.
436 .PP
437 \fBParameters:\fP
438 .RS 4
439 \fIcontext\fP A hx509 context. 
440 .br
441 \fIptr\fP pointer to memory region containing encoded certificate. 
442 .br
443 \fIlen\fP length of memory region. 
444 .br
445 \fIcert\fP a return pointer to a hx509 certificate object, will contain NULL on error.
446 .RE
447 .PP
448 \fBReturns:\fP
449 .RS 4
450 An hx509 error code, see \fBhx509_get_error_string()\fP. 
451 .RE
452 .PP
453
454 .SS "hx509_cert hx509_cert_ref (hx509_cert cert)"
455 .PP
456 Add a reference to a hx509 certificate object.
457 .PP
458 \fBParameters:\fP
459 .RS 4
460 \fIcert\fP a pointer to an hx509 certificate object.
461 .RE
462 .PP
463 \fBReturns:\fP
464 .RS 4
465 the same object as is passed in. 
466 .RE
467 .PP
468
469 .SS "int hx509_cert_set_friendly_name (hx509_cert cert, const char * name)"
470 .PP
471 Set the friendly name on the certificate.
472 .PP
473 \fBParameters:\fP
474 .RS 4
475 \fIcert\fP The certificate to set the friendly name on 
476 .br
477 \fIname\fP Friendly name.
478 .RE
479 .PP
480 \fBReturns:\fP
481 .RS 4
482 An hx509 error code, see \fBhx509_get_error_string()\fP. 
483 .RE
484 .PP
485
486 .SS "int hx509_print_cert (hx509_context context, hx509_cert cert, FILE * out)"
487 .PP
488 Print a simple representation of a certificate
489 .PP
490 \fBParameters:\fP
491 .RS 4
492 \fIcontext\fP A hx509 context, can be NULL 
493 .br
494 \fIcert\fP certificate to print 
495 .br
496 \fIout\fP the stdio output stream, if NULL, stdout is used
497 .RE
498 .PP
499 \fBReturns:\fP
500 .RS 4
501 An hx509 error code 
502 .RE
503 .PP
504
505 .SS "int hx509_query_alloc (hx509_context context, hx509_query ** q)"
506 .PP
507 Allocate an query controller. Free using \fBhx509_query_free()\fP.
508 .PP
509 \fBParameters:\fP
510 .RS 4
511 \fIcontext\fP A hx509 context. 
512 .br
513 \fIq\fP return pointer to a hx509_query.
514 .RE
515 .PP
516 \fBReturns:\fP
517 .RS 4
518 An hx509 error code, see \fBhx509_get_error_string()\fP. 
519 .RE
520 .PP
521
522 .SS "void hx509_query_free (hx509_context context, hx509_query * q)"
523 .PP
524 Free the query controller.
525 .PP
526 \fBParameters:\fP
527 .RS 4
528 \fIcontext\fP A hx509 context. 
529 .br
530 \fIq\fP a pointer to the query controller. 
531 .RE
532 .PP
533
534 .SS "int hx509_query_match_cmp_func (hx509_query * q, int(*)(hx509_context, hx509_cert, void *) func, void * ctx)"
535 .PP
536 Set the query controller to match using a specific match function.
537 .PP
538 \fBParameters:\fP
539 .RS 4
540 \fIq\fP a hx509 query controller. 
541 .br
542 \fIfunc\fP function to use for matching, if the argument is NULL, the match function is removed. 
543 .br
544 \fIctx\fP context passed to the function.
545 .RE
546 .PP
547 \fBReturns:\fP
548 .RS 4
549 An hx509 error code, see \fBhx509_get_error_string()\fP. 
550 .RE
551 .PP
552
553 .SS "int hx509_query_match_eku (hx509_query * q, const heim_oid * eku)"
554 .PP
555 Set the query controller to require an one specific EKU (extended key usage). Any previous EKU matching is overwitten. If NULL is passed in as the eku, the EKU requirement is reset.
556 .PP
557 \fBParameters:\fP
558 .RS 4
559 \fIq\fP a hx509 query controller. 
560 .br
561 \fIeku\fP an EKU to match on.
562 .RE
563 .PP
564 \fBReturns:\fP
565 .RS 4
566 An hx509 error code, see \fBhx509_get_error_string()\fP. 
567 .RE
568 .PP
569
570 .SS "int hx509_query_match_friendly_name (hx509_query * q, const char * name)"
571 .PP
572 Set the query controller to match on a friendly name
573 .PP
574 \fBParameters:\fP
575 .RS 4
576 \fIq\fP a hx509 query controller. 
577 .br
578 \fIname\fP a friendly name to match on
579 .RE
580 .PP
581 \fBReturns:\fP
582 .RS 4
583 An hx509 error code, see \fBhx509_get_error_string()\fP. 
584 .RE
585 .PP
586
587 .SS "int hx509_query_match_issuer_serial (hx509_query * q, const Name * issuer, const heim_integer * serialNumber)"
588 .PP
589 Set the issuer and serial number of match in the query controller. The function make copies of the isser and serial number.
590 .PP
591 \fBParameters:\fP
592 .RS 4
593 \fIq\fP a hx509 query controller 
594 .br
595 \fIissuer\fP issuer to search for 
596 .br
597 \fIserialNumber\fP the serialNumber of the issuer.
598 .RE
599 .PP
600 \fBReturns:\fP
601 .RS 4
602 An hx509 error code, see \fBhx509_get_error_string()\fP. 
603 .RE
604 .PP
605
606 .SS "void hx509_query_match_option (hx509_query * q, hx509_query_option option)"
607 .PP
608 Set match options for the hx509 query controller.
609 .PP
610 \fBParameters:\fP
611 .RS 4
612 \fIq\fP query controller. 
613 .br
614 \fIoption\fP options to control the query controller.
615 .RE
616 .PP
617 \fBReturns:\fP
618 .RS 4
619 An hx509 error code, see \fBhx509_get_error_string()\fP. 
620 .RE
621 .PP
622
623 .SS "void hx509_query_statistic_file (hx509_context context, const char * fn)"
624 .PP
625 Set a statistic file for the query statistics.
626 .PP
627 \fBParameters:\fP
628 .RS 4
629 \fIcontext\fP A hx509 context. 
630 .br
631 \fIfn\fP statistics file name 
632 .RE
633 .PP
634
635 .SS "void hx509_query_unparse_stats (hx509_context context, int printtype, FILE * out)"
636 .PP
637 Unparse the statistics file and print the result on a FILE descriptor.
638 .PP
639 \fBParameters:\fP
640 .RS 4
641 \fIcontext\fP A hx509 context. 
642 .br
643 \fIprinttype\fP tyep to print 
644 .br
645 \fIout\fP the FILE to write the data on. 
646 .RE
647 .PP
648
649 .SS "void hx509_verify_ctx_f_allow_default_trustanchors (hx509_verify_ctx ctx, int boolean)"
650 .PP
651 Allow using the operating system builtin trust anchors if no other trust anchors are configured.
652 .PP
653 \fBParameters:\fP
654 .RS 4
655 \fIctx\fP a verification context 
656 .br
657 \fIboolean\fP if non zero, useing the operating systems builtin trust anchors.
658 .RE
659 .PP
660 \fBReturns:\fP
661 .RS 4
662 An hx509 error code, see \fBhx509_get_error_string()\fP. 
663 .RE
664 .PP
665
666 .SS "int hx509_verify_hostname (hx509_context context, const hx509_cert cert, int flags, hx509_hostname_type type, const char * hostname, const struct sockaddr * sa, int sa_size)"
667 .PP
668 Verify that the certificate is allowed to be used for the hostname and address.
669 .PP
670 \fBParameters:\fP
671 .RS 4
672 \fIcontext\fP A hx509 context. 
673 .br
674 \fIcert\fP the certificate to match with 
675 .br
676 \fIflags\fP Flags to modify the behavior:
677 .IP "\(bu" 2
678 HX509_VHN_F_ALLOW_NO_MATCH no match is ok 
679 .PP
680 .br
681 \fItype\fP type of hostname:
682 .IP "\(bu" 2
683 HX509_HN_HOSTNAME for plain hostname.
684 .IP "\(bu" 2
685 HX509_HN_DNSSRV for DNS SRV names. 
686 .PP
687 .br
688 \fIhostname\fP the hostname to check 
689 .br
690 \fIsa\fP address of the host 
691 .br
692 \fIsa_size\fP length of address
693 .RE
694 .PP
695 \fBReturns:\fP
696 .RS 4
697 An hx509 error code, see \fBhx509_get_error_string()\fP. 
698 .RE
699 .PP
700