summaryrefslogtreecommitdiffstats
path: root/doc/doxyout/hx509/man/man3/hx509_cert.3
blob: f57b5438f3c959e19a06bcd05a17b828d39f043e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
.TH "hx509 certificate functions" 3 "30 Sep 2011" "Version 1.5.1" "Heimdalx509library" \" -*- nroff -*-
.ad l
.nh
.SH NAME
hx509 certificate functions \- 
.SS "Functions"

.in +1c
.ti -1c
.RI "int \fBhx509_cert_init\fP (hx509_context context, const Certificate *c, hx509_cert *cert)"
.br
.ti -1c
.RI "int \fBhx509_cert_init_data\fP (hx509_context context, const void *ptr, size_t len, hx509_cert *cert)"
.br
.ti -1c
.RI "void \fBhx509_cert_free\fP (hx509_cert cert)"
.br
.ti -1c
.RI "hx509_cert \fBhx509_cert_ref\fP (hx509_cert cert)"
.br
.ti -1c
.RI "void \fBhx509_verify_ctx_f_allow_default_trustanchors\fP (hx509_verify_ctx ctx, int boolean)"
.br
.ti -1c
.RI "int \fBhx509_cert_find_subjectAltName_otherName\fP (hx509_context context, hx509_cert cert, const heim_oid *oid, hx509_octet_string_list *list)"
.br
.ti -1c
.RI "int \fBhx509_cert_cmp\fP (hx509_cert p, hx509_cert q)"
.br
.ti -1c
.RI "int \fBhx509_cert_get_issuer\fP (hx509_cert p, hx509_name *name)"
.br
.ti -1c
.RI "int \fBhx509_cert_get_subject\fP (hx509_cert p, hx509_name *name)"
.br
.ti -1c
.RI "int \fBhx509_cert_get_base_subject\fP (hx509_context context, hx509_cert c, hx509_name *name)"
.br
.ti -1c
.RI "int \fBhx509_cert_get_serialnumber\fP (hx509_cert p, heim_integer *i)"
.br
.ti -1c
.RI "time_t \fBhx509_cert_get_notBefore\fP (hx509_cert p)"
.br
.ti -1c
.RI "time_t \fBhx509_cert_get_notAfter\fP (hx509_cert p)"
.br
.ti -1c
.RI "int \fBhx509_cert_get_SPKI\fP (hx509_context context, hx509_cert p, SubjectPublicKeyInfo *spki)"
.br
.ti -1c
.RI "int \fBhx509_cert_get_SPKI_AlgorithmIdentifier\fP (hx509_context context, hx509_cert p, AlgorithmIdentifier *alg)"
.br
.ti -1c
.RI "int \fBhx509_cert_get_issuer_unique_id\fP (hx509_context context, hx509_cert p, heim_bit_string *issuer)"
.br
.ti -1c
.RI "int \fBhx509_cert_get_subject_unique_id\fP (hx509_context context, hx509_cert p, heim_bit_string *subject)"
.br
.ti -1c
.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)"
.br
.ti -1c
.RI "hx509_cert_attribute \fBhx509_cert_get_attribute\fP (hx509_cert cert, const heim_oid *oid)"
.br
.ti -1c
.RI "int \fBhx509_cert_set_friendly_name\fP (hx509_cert cert, const char *name)"
.br
.ti -1c
.RI "const char * \fBhx509_cert_get_friendly_name\fP (hx509_cert cert)"
.br
.ti -1c
.RI "int \fBhx509_query_alloc\fP (hx509_context context, hx509_query **q)"
.br
.ti -1c
.RI "void \fBhx509_query_match_option\fP (hx509_query *q, hx509_query_option option)"
.br
.ti -1c
.RI "int \fBhx509_query_match_issuer_serial\fP (hx509_query *q, const Name *issuer, const heim_integer *serialNumber)"
.br
.ti -1c
.RI "int \fBhx509_query_match_friendly_name\fP (hx509_query *q, const char *name)"
.br
.ti -1c
.RI "int \fBhx509_query_match_eku\fP (hx509_query *q, const heim_oid *eku)"
.br
.ti -1c
.RI "int \fBhx509_query_match_cmp_func\fP (hx509_query *q, int(*func)(hx509_context, hx509_cert, void *), void *ctx)"
.br
.ti -1c
.RI "void \fBhx509_query_free\fP (hx509_context context, hx509_query *q)"
.br
.ti -1c
.RI "void \fBhx509_query_statistic_file\fP (hx509_context context, const char *fn)"
.br
.ti -1c
.RI "void \fBhx509_query_unparse_stats\fP (hx509_context context, int printtype, FILE *out)"
.br
.ti -1c
.RI "int \fBhx509_cert_check_eku\fP (hx509_context context, hx509_cert cert, const heim_oid *eku, int allow_any_eku)"
.br
.ti -1c
.RI "int \fBhx509_cert_binary\fP (hx509_context context, hx509_cert c, heim_octet_string *os)"
.br
.ti -1c
.RI "int \fBhx509_print_cert\fP (hx509_context context, hx509_cert cert, FILE *out)"
.br
.in -1c
.SH "Detailed Description"
.PP 
See the \fBThe basic certificate\fP for description and examples. 
.SH "Function Documentation"
.PP 
.SS "int hx509_cert_binary (hx509_context context, hx509_cert c, heim_octet_string * os)"
.PP
Encodes the hx509 certificate as a DER encode binary.
.PP
\fBParameters:\fP
.RS 4
\fIcontext\fP A hx509 context. 
.br
\fIc\fP the certificate to encode. 
.br
\fIos\fP the encode certificate, set to NULL, 0 on case of error. Free the os->data with \fBhx509_xfree()\fP.
.RE
.PP
\fBReturns:\fP
.RS 4
An hx509 error code, see \fBhx509_get_error_string()\fP. 
.RE
.PP

.SS "int hx509_cert_check_eku (hx509_context context, hx509_cert cert, const heim_oid * eku, int allow_any_eku)"
.PP
Check the extended key usage on the hx509 certificate.
.PP
\fBParameters:\fP
.RS 4
\fIcontext\fP A hx509 context. 
.br
\fIcert\fP A hx509 context. 
.br
\fIeku\fP the EKU to check for 
.br
\fIallow_any_eku\fP if the any EKU is set, allow that to be a substitute.
.RE
.PP
\fBReturns:\fP
.RS 4
An hx509 error code, see \fBhx509_get_error_string()\fP. 
.RE
.PP

.SS "int hx509_cert_cmp (hx509_cert p, hx509_cert q)"
.PP
Compare to hx509 certificate object, useful for sorting.
.PP
\fBParameters:\fP
.RS 4
\fIp\fP a hx509 certificate object. 
.br
\fIq\fP a hx509 certificate object.
.RE
.PP
\fBReturns:\fP
.RS 4
0 the objects are the same, returns > 0 is p is 'larger' then q, < 0 if p is 'smaller' then q. 
.RE
.PP

.SS "int hx509_cert_find_subjectAltName_otherName (hx509_context context, hx509_cert cert, const heim_oid * oid, hx509_octet_string_list * list)"
.PP
Return a list of subjectAltNames specified by oid in the certificate. On error the
.PP
The returned list of octet string should be freed with \fBhx509_free_octet_string_list()\fP.
.PP
\fBParameters:\fP
.RS 4
\fIcontext\fP A hx509 context. 
.br
\fIcert\fP a hx509 certificate object. 
.br
\fIoid\fP an oid to for SubjectAltName. 
.br
\fIlist\fP list of matching SubjectAltName.
.RE
.PP
\fBReturns:\fP
.RS 4
An hx509 error code, see \fBhx509_get_error_string()\fP. 
.RE
.PP

.SS "void hx509_cert_free (hx509_cert cert)"
.PP
Free reference to the hx509 certificate object, if the refcounter reaches 0, the object if freed. Its allowed to pass in NULL.
.PP
\fBParameters:\fP
.RS 4
\fIcert\fP the cert to free. 
.RE
.PP

.SS "hx509_cert_attribute hx509_cert_get_attribute (hx509_cert cert, const heim_oid * oid)"
.PP
Get an external attribute for the certificate, examples are friendly name and id.
.PP
\fBParameters:\fP
.RS 4
\fIcert\fP hx509 certificate object to search 
.br
\fIoid\fP an oid to search for.
.RE
.PP
\fBReturns:\fP
.RS 4
an hx509_cert_attribute, only valid as long as the certificate is referenced. 
.RE
.PP

.SS "int hx509_cert_get_base_subject (hx509_context context, hx509_cert c, hx509_name * name)"
.PP
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.
.PP
\fBParameters:\fP
.RS 4
\fIcontext\fP a hx509 context. 
.br
\fIc\fP a hx509 certificate object. 
.br
\fIname\fP a pointer to a hx509 name, should be freed by \fBhx509_name_free()\fP. See also \fBhx509_cert_get_subject()\fP.
.RE
.PP
\fBReturns:\fP
.RS 4
An hx509 error code, see \fBhx509_get_error_string()\fP. 
.RE
.PP

.SS "const char* hx509_cert_get_friendly_name (hx509_cert cert)"
.PP
Get friendly name of the certificate.
.PP
\fBParameters:\fP
.RS 4
\fIcert\fP cert to get the friendly name from.
.RE
.PP
\fBReturns:\fP
.RS 4
an friendly name or NULL if there is. The friendly name is only valid as long as the certificate is referenced. 
.RE
.PP

.SS "int hx509_cert_get_issuer (hx509_cert p, hx509_name * name)"
.PP
Return the name of the issuer of the hx509 certificate.
.PP
\fBParameters:\fP
.RS 4
\fIp\fP a hx509 certificate object. 
.br
\fIname\fP a pointer to a hx509 name, should be freed by \fBhx509_name_free()\fP.
.RE
.PP
\fBReturns:\fP
.RS 4
An hx509 error code, see \fBhx509_get_error_string()\fP. 
.RE
.PP

.SS "int hx509_cert_get_issuer_unique_id (hx509_context context, hx509_cert p, heim_bit_string * issuer)"
.PP
Get a copy of the Issuer Unique ID
.PP
\fBParameters:\fP
.RS 4
\fIcontext\fP a hx509_context 
.br
\fIp\fP a hx509 certificate 
.br
\fIissuer\fP the issuer id returned, free with der_free_bit_string()
.RE
.PP
\fBReturns:\fP
.RS 4
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 
.RE
.PP

.SS "time_t hx509_cert_get_notAfter (hx509_cert p)"
.PP
Get notAfter time of the certificate.
.PP
\fBParameters:\fP
.RS 4
\fIp\fP a hx509 certificate object.
.RE
.PP
\fBReturns:\fP
.RS 4
return not after time. 
.RE
.PP

.SS "time_t hx509_cert_get_notBefore (hx509_cert p)"
.PP
Get notBefore time of the certificate.
.PP
\fBParameters:\fP
.RS 4
\fIp\fP a hx509 certificate object.
.RE
.PP
\fBReturns:\fP
.RS 4
return not before time 
.RE
.PP

.SS "int hx509_cert_get_serialnumber (hx509_cert p, heim_integer * i)"
.PP
Get serial number of the certificate.
.PP
\fBParameters:\fP
.RS 4
\fIp\fP a hx509 certificate object. 
.br
\fIi\fP serial number, should be freed ith der_free_heim_integer().
.RE
.PP
\fBReturns:\fP
.RS 4
An hx509 error code, see \fBhx509_get_error_string()\fP. 
.RE
.PP

.SS "int hx509_cert_get_SPKI (hx509_context context, hx509_cert p, SubjectPublicKeyInfo * spki)"
.PP
Get the SubjectPublicKeyInfo structure from the hx509 certificate.
.PP
\fBParameters:\fP
.RS 4
\fIcontext\fP a hx509 context. 
.br
\fIp\fP a hx509 certificate object. 
.br
\fIspki\fP SubjectPublicKeyInfo, should be freed with free_SubjectPublicKeyInfo().
.RE
.PP
\fBReturns:\fP
.RS 4
An hx509 error code, see \fBhx509_get_error_string()\fP. 
.RE
.PP

.SS "int hx509_cert_get_SPKI_AlgorithmIdentifier (hx509_context context, hx509_cert p, AlgorithmIdentifier * alg)"
.PP
Get the AlgorithmIdentifier from the hx509 certificate.
.PP
\fBParameters:\fP
.RS 4
\fIcontext\fP a hx509 context. 
.br
\fIp\fP a hx509 certificate object. 
.br
\fIalg\fP AlgorithmIdentifier, should be freed with free_AlgorithmIdentifier(). The algorithmidentifier is typicly rsaEncryption, or id-ecPublicKey, or some other public key mechanism.
.RE
.PP
\fBReturns:\fP
.RS 4
An hx509 error code, see \fBhx509_get_error_string()\fP. 
.RE
.PP

.SS "int hx509_cert_get_subject (hx509_cert p, hx509_name * name)"
.PP
Return the name of the subject of the hx509 certificate.
.PP
\fBParameters:\fP
.RS 4
\fIp\fP a hx509 certificate object. 
.br
\fIname\fP a pointer to a hx509 name, should be freed by \fBhx509_name_free()\fP. See also \fBhx509_cert_get_base_subject()\fP.
.RE
.PP
\fBReturns:\fP
.RS 4
An hx509 error code, see \fBhx509_get_error_string()\fP. 
.RE
.PP

.SS "int hx509_cert_get_subject_unique_id (hx509_context context, hx509_cert p, heim_bit_string * subject)"
.PP
Get a copy of the Subect Unique ID
.PP
\fBParameters:\fP
.RS 4
\fIcontext\fP a hx509_context 
.br
\fIp\fP a hx509 certificate 
.br
\fIsubject\fP the subject id returned, free with der_free_bit_string()
.RE
.PP
\fBReturns:\fP
.RS 4
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 
.RE
.PP

.SS "int hx509_cert_init (hx509_context context, const Certificate * c, hx509_cert * cert)"
.PP
Allocate and init an hx509 certificate object from the decoded certificate `c´.
.PP
\fBParameters:\fP
.RS 4
\fIcontext\fP A hx509 context. 
.br
\fIc\fP 
.br
\fIcert\fP 
.RE
.PP
\fBReturns:\fP
.RS 4
Returns an hx509 error code. 
.RE
.PP

.SS "int hx509_cert_init_data (hx509_context context, const void * ptr, size_t len, hx509_cert * cert)"
.PP
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.
.PP
If the memory region doesn't contain just the certificate and nothing more the function will fail with HX509_EXTRA_DATA_AFTER_STRUCTURE.
.PP
\fBParameters:\fP
.RS 4
\fIcontext\fP A hx509 context. 
.br
\fIptr\fP pointer to memory region containing encoded certificate. 
.br
\fIlen\fP length of memory region. 
.br
\fIcert\fP a return pointer to a hx509 certificate object, will contain NULL on error.
.RE
.PP
\fBReturns:\fP
.RS 4
An hx509 error code, see \fBhx509_get_error_string()\fP. 
.RE
.PP

.SS "hx509_cert hx509_cert_ref (hx509_cert cert)"
.PP
Add a reference to a hx509 certificate object.
.PP
\fBParameters:\fP
.RS 4
\fIcert\fP a pointer to an hx509 certificate object.
.RE
.PP
\fBReturns:\fP
.RS 4
the same object as is passed in. 
.RE
.PP

.SS "int hx509_cert_set_friendly_name (hx509_cert cert, const char * name)"
.PP
Set the friendly name on the certificate.
.PP
\fBParameters:\fP
.RS 4
\fIcert\fP The certificate to set the friendly name on 
.br
\fIname\fP Friendly name.
.RE
.PP
\fBReturns:\fP
.RS 4
An hx509 error code, see \fBhx509_get_error_string()\fP. 
.RE
.PP

.SS "int hx509_print_cert (hx509_context context, hx509_cert cert, FILE * out)"
.PP
Print a simple representation of a certificate
.PP
\fBParameters:\fP
.RS 4
\fIcontext\fP A hx509 context, can be NULL 
.br
\fIcert\fP certificate to print 
.br
\fIout\fP the stdio output stream, if NULL, stdout is used
.RE
.PP
\fBReturns:\fP
.RS 4
An hx509 error code 
.RE
.PP

.SS "int hx509_query_alloc (hx509_context context, hx509_query ** q)"
.PP
Allocate an query controller. Free using \fBhx509_query_free()\fP.
.PP
\fBParameters:\fP
.RS 4
\fIcontext\fP A hx509 context. 
.br
\fIq\fP return pointer to a hx509_query.
.RE
.PP
\fBReturns:\fP
.RS 4
An hx509 error code, see \fBhx509_get_error_string()\fP. 
.RE
.PP

.SS "void hx509_query_free (hx509_context context, hx509_query * q)"
.PP
Free the query controller.
.PP
\fBParameters:\fP
.RS 4
\fIcontext\fP A hx509 context. 
.br
\fIq\fP a pointer to the query controller. 
.RE
.PP

.SS "int hx509_query_match_cmp_func (hx509_query * q, int(*)(hx509_context, hx509_cert, void *) func, void * ctx)"
.PP
Set the query controller to match using a specific match function.
.PP
\fBParameters:\fP
.RS 4
\fIq\fP a hx509 query controller. 
.br
\fIfunc\fP function to use for matching, if the argument is NULL, the match function is removed. 
.br
\fIctx\fP context passed to the function.
.RE
.PP
\fBReturns:\fP
.RS 4
An hx509 error code, see \fBhx509_get_error_string()\fP. 
.RE
.PP

.SS "int hx509_query_match_eku (hx509_query * q, const heim_oid * eku)"
.PP
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.
.PP
\fBParameters:\fP
.RS 4
\fIq\fP a hx509 query controller. 
.br
\fIeku\fP an EKU to match on.
.RE
.PP
\fBReturns:\fP
.RS 4
An hx509 error code, see \fBhx509_get_error_string()\fP. 
.RE
.PP

.SS "int hx509_query_match_friendly_name (hx509_query * q, const char * name)"
.PP
Set the query controller to match on a friendly name
.PP
\fBParameters:\fP
.RS 4
\fIq\fP a hx509 query controller. 
.br
\fIname\fP a friendly name to match on
.RE
.PP
\fBReturns:\fP
.RS 4
An hx509 error code, see \fBhx509_get_error_string()\fP. 
.RE
.PP

.SS "int hx509_query_match_issuer_serial (hx509_query * q, const Name * issuer, const heim_integer * serialNumber)"
.PP
Set the issuer and serial number of match in the query controller. The function make copies of the isser and serial number.
.PP
\fBParameters:\fP
.RS 4
\fIq\fP a hx509 query controller 
.br
\fIissuer\fP issuer to search for 
.br
\fIserialNumber\fP the serialNumber of the issuer.
.RE
.PP
\fBReturns:\fP
.RS 4
An hx509 error code, see \fBhx509_get_error_string()\fP. 
.RE
.PP

.SS "void hx509_query_match_option (hx509_query * q, hx509_query_option option)"
.PP
Set match options for the hx509 query controller.
.PP
\fBParameters:\fP
.RS 4
\fIq\fP query controller. 
.br
\fIoption\fP options to control the query controller.
.RE
.PP
\fBReturns:\fP
.RS 4
An hx509 error code, see \fBhx509_get_error_string()\fP. 
.RE
.PP

.SS "void hx509_query_statistic_file (hx509_context context, const char * fn)"
.PP
Set a statistic file for the query statistics.
.PP
\fBParameters:\fP
.RS 4
\fIcontext\fP A hx509 context. 
.br
\fIfn\fP statistics file name 
.RE
.PP

.SS "void hx509_query_unparse_stats (hx509_context context, int printtype, FILE * out)"
.PP
Unparse the statistics file and print the result on a FILE descriptor.
.PP
\fBParameters:\fP
.RS 4
\fIcontext\fP A hx509 context. 
.br
\fIprinttype\fP tyep to print 
.br
\fIout\fP the FILE to write the data on. 
.RE
.PP

.SS "void hx509_verify_ctx_f_allow_default_trustanchors (hx509_verify_ctx ctx, int boolean)"
.PP
Allow using the operating system builtin trust anchors if no other trust anchors are configured.
.PP
\fBParameters:\fP
.RS 4
\fIctx\fP a verification context 
.br
\fIboolean\fP if non zero, useing the operating systems builtin trust anchors.
.RE
.PP
\fBReturns:\fP
.RS 4
An hx509 error code, see \fBhx509_get_error_string()\fP. 
.RE
.PP

.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)"
.PP
Verify that the certificate is allowed to be used for the hostname and address.
.PP
\fBParameters:\fP
.RS 4
\fIcontext\fP A hx509 context. 
.br
\fIcert\fP the certificate to match with 
.br
\fIflags\fP Flags to modify the behavior:
.IP "\(bu" 2
HX509_VHN_F_ALLOW_NO_MATCH no match is ok 
.PP
.br
\fItype\fP type of hostname:
.IP "\(bu" 2
HX509_HN_HOSTNAME for plain hostname.
.IP "\(bu" 2
HX509_HN_DNSSRV for DNS SRV names. 
.PP
.br
\fIhostname\fP the hostname to check 
.br
\fIsa\fP address of the host 
.br
\fIsa_size\fP length of address
.RE
.PP
\fBReturns:\fP
.RS 4
An hx509 error code, see \fBhx509_get_error_string()\fP. 
.RE
.PP

OpenPOWER on IntegriCloud