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
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<!-- This manual is last updated 4 March 2015 for version
3.5.3 of GnuTLS.
Copyright (C) 2001-2015 Free Software Foundation, Inc.\\
Copyright (C) 2001-2015 Nikos Mavrogiannopoulos
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3 or
any later version published by the Free Software Foundation; with no
Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A
copy of the license is included in the section entitled "GNU Free
Documentation License". -->
<!-- Created by GNU Texinfo 6.1, http://www.gnu.org/software/texinfo/ -->
<head>
<title>GnuTLS 3.5.3: Verifying X.509 certificate paths</title>
<meta name="description" content="GnuTLS 3.5.3: Verifying X.509 certificate paths">
<meta name="keywords" content="GnuTLS 3.5.3: Verifying X.509 certificate paths">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="index.html#Top" rel="start" title="Top">
<link href="Function-and-Data-Index.html#Function-and-Data-Index" rel="index" title="Function and Data Index">
<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
<link href="X_002e509-certificates.html#X_002e509-certificates" rel="up" title="X.509 certificates">
<link href="Verifying-a-certificate-in-the-context-of-TLS-session.html#Verifying-a-certificate-in-the-context-of-TLS-session" rel="next" title="Verifying a certificate in the context of TLS session">
<link href="X_002e509-public-and-private-keys.html#X_002e509-public-and-private-keys" rel="prev" title="X.509 public and private keys">
<style type="text/css">
<!--
a.summary-letter {text-decoration: none}
blockquote.indentedblock {margin-right: 0em}
blockquote.smallindentedblock {margin-right: 0em; font-size: smaller}
blockquote.smallquotation {font-size: smaller}
div.display {margin-left: 3.2em}
div.example {margin-left: 3.2em}
div.lisp {margin-left: 3.2em}
div.smalldisplay {margin-left: 3.2em}
div.smallexample {margin-left: 3.2em}
div.smalllisp {margin-left: 3.2em}
kbd {font-style: oblique}
pre.display {font-family: inherit}
pre.format {font-family: inherit}
pre.menu-comment {font-family: serif}
pre.menu-preformatted {font-family: serif}
pre.smalldisplay {font-family: inherit; font-size: smaller}
pre.smallexample {font-size: smaller}
pre.smallformat {font-family: inherit; font-size: smaller}
pre.smalllisp {font-size: smaller}
span.nolinebreak {white-space: nowrap}
span.roman {font-family: initial; font-weight: normal}
span.sansserif {font-family: sans-serif; font-weight: normal}
ul.no-bullet {list-style: none}
body {
margin: 2%;
padding: 0 5%;
background: #ffffff;
}
h1,h2,h3,h4,h5 {
font-weight: bold;
padding: 5px 5px 5px 5px;
background-color: #c2e0ff;
color: #336699;
}
h1 {
padding: 2em 2em 2em 5%;
color: white;
background: #336699;
text-align: center;
letter-spacing: 3px;
}
h2 { text-decoration: underline; }
pre {
margin: 0 5%;
padding: 0.5em;
}
pre.example,pre.verbatim {
padding-bottom: 1em;
border: solid #c2e0ff;
background: #f0faff;
border-width: 1px 1px 1px 5px;
margin: 1em auto;
width: 90%;
}
div.node {
margin: 0 -5% 0 -2%;
padding: 0.5em 0.5em;
margin-top: 0.5em;
margin-bottom: 0.5em;
font-weight: bold;
}
dd, li {
padding-top: 0.1em;
padding-bottom: 0.1em;
}
div.float {
margin-bottom: 0.5em;
text-align: center;
}
table {
text-align: left;
margin-left:auto;
margin-right:auto;
border-spacing: 7px;
width: 50%;
}
th {
padding: 0;
color: #336699;
background-color: #c2e0ff;
border: solid #000000;
border-width: 0px;
margin: 1em auto;
text-align: center;
margin-left:auto;
margin-right:auto;
}
td {
padding: 0;
border: solid #000000;
background-color: #f0faff;
border-width: 0px;
margin: 1em auto;
text-align: left;
margin-left:auto;
margin-right:auto;
padding-left: 1em;
}
dl {
text-align: left;
margin-left:auto;
margin-right:auto;
width: 50%;
padding-left: 1em;
border: solid #c2e0ff;
background: #f0faff;
border-width: 5px 1px 1px 1px;
margin: 1em auto;
}
-->
</style>
</head>
<body lang="en">
<a name="Verifying-X_002e509-certificate-paths"></a>
<div class="header">
<p>
Next: <a href="Verifying-a-certificate-in-the-context-of-TLS-session.html#Verifying-a-certificate-in-the-context-of-TLS-session" accesskey="n" rel="next">Verifying a certificate in the context of TLS session</a>, Previous: <a href="X_002e509-public-and-private-keys.html#X_002e509-public-and-private-keys" accesskey="p" rel="prev">X.509 public and private keys</a>, Up: <a href="X_002e509-certificates.html#X_002e509-certificates" accesskey="u" rel="up">X.509 certificates</a> [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Function-and-Data-Index.html#Function-and-Data-Index" title="Index" rel="index">Index</a>]</p>
</div>
<hr>
<a name="Verifying-X_002e509-certificate-paths-1"></a>
<h4 class="subsubsection">4.1.1.7 Verifying <acronym>X.509</acronym> certificate paths</h4>
<a name="index-verifying-certificate-paths"></a>
<p>Verifying certificate paths is important in <acronym>X.509</acronym>
authentication. For this purpose the following functions are
provided.
</p>
<dl>
<dt><a name="index-gnutls_005fx509_005ftrust_005flist_005fadd_005fcas"></a>Function: <em>int</em> <strong>gnutls_x509_trust_list_add_cas</strong> <em>(gnutls_x509_trust_list_t <var>list</var>, const gnutls_x509_crt_t * <var>clist</var>, unsigned <var>clist_size</var>, unsigned int <var>flags</var>)</em></dt>
<dd><p><var>list</var>: The list
</p>
<p><var>clist</var>: A list of CAs
</p>
<p><var>clist_size</var>: The length of the CA list
</p>
<p><var>flags</var>: should be 0 or an or’ed sequence of <code>GNUTLS_TL</code> options.
</p>
<p>This function will add the given certificate authorities
to the trusted list. The list of CAs must not be deinitialized
during this structure’s lifetime.
</p>
<p>If the flag <code>GNUTLS_TL_NO_DUPLICATES</code> is specified, then
the provided <code>clist</code> entries that are duplicates will not be
added to the list and will be deinitialized.
</p>
<p><strong>Returns:</strong> The number of added elements is returned.
</p>
<p><strong>Since:</strong> 3.0.0
</p></dd></dl>
<dl>
<dt><a name="index-gnutls_005fx509_005ftrust_005flist_005fadd_005fnamed_005fcrt"></a>Function: <em>int</em> <strong>gnutls_x509_trust_list_add_named_crt</strong> <em>(gnutls_x509_trust_list_t <var>list</var>, gnutls_x509_crt_t <var>cert</var>, const void * <var>name</var>, size_t <var>name_size</var>, unsigned int <var>flags</var>)</em></dt>
<dd><p><var>list</var>: The list
</p>
<p><var>cert</var>: A certificate
</p>
<p><var>name</var>: An identifier for the certificate
</p>
<p><var>name_size</var>: The size of the identifier
</p>
<p><var>flags</var>: should be 0.
</p>
<p>This function will add the given certificate to the trusted
list and associate it with a name. The certificate will not be
be used for verification with <code>gnutls_x509_trust_list_verify_crt()</code>
but with <code>gnutls_x509_trust_list_verify_named_crt()</code> or
<code>gnutls_x509_trust_list_verify_crt2()</code> - the latter only since
GnuTLS 3.4.0 and if a hostname is provided.
</p>
<p>In principle this function can be used to set individual "server"
certificates that are trusted by the user for that specific server
but for no other purposes.
</p>
<p>The certificate must not be deinitialized during the lifetime
of the trusted list.
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code> (0) is returned, otherwise a
negative error value.
</p>
<p><strong>Since:</strong> 3.0.0
</p></dd></dl>
<dl>
<dt><a name="index-gnutls_005fx509_005ftrust_005flist_005fadd_005fcrls"></a>Function: <em>int</em> <strong>gnutls_x509_trust_list_add_crls</strong> <em>(gnutls_x509_trust_list_t <var>list</var>, const gnutls_x509_crl_t * <var>crl_list</var>, unsigned <var>crl_size</var>, unsigned int <var>flags</var>, unsigned int <var>verification_flags</var>)</em></dt>
<dd><p><var>list</var>: The list
</p>
<p><var>crl_list</var>: A list of CRLs
</p>
<p><var>crl_size</var>: The length of the CRL list
</p>
<p><var>flags</var>: if GNUTLS_TL_VERIFY_CRL is given the CRLs will be verified before being added.
</p>
<p><var>verification_flags</var>: gnutls_certificate_verify_flags if flags specifies GNUTLS_TL_VERIFY_CRL
</p>
<p>This function will add the given certificate revocation lists
to the trusted list. The list of CRLs must not be deinitialized
during this structure’s lifetime.
</p>
<p>This function must be called after <code>gnutls_x509_trust_list_add_cas()</code>
to allow verifying the CRLs for validity. If the flag <code>GNUTLS_TL_NO_DUPLICATES</code>
is given, then any provided CRLs that are a duplicate, will be deinitialized
and not added to the list (that assumes that <code>gnutls_x509_trust_list_deinit()</code>
will be called with all=1).
</p>
<p><strong>Returns:</strong> The number of added elements is returned.
</p>
<p><strong>Since:</strong> 3.0
</p></dd></dl>
<dl>
<dt><a name="index-gnutls_005fx509_005ftrust_005flist_005fverify_005fcrt"></a>Function: <em>int</em> <strong>gnutls_x509_trust_list_verify_crt</strong> <em>(gnutls_x509_trust_list_t <var>list</var>, gnutls_x509_crt_t * <var>cert_list</var>, unsigned int <var>cert_list_size</var>, unsigned int <var>flags</var>, unsigned int * <var>voutput</var>, gnutls_verify_output_function <var>func</var>)</em></dt>
<dd><p><var>list</var>: The list
</p>
<p><var>cert_list</var>: is the certificate list to be verified
</p>
<p><var>cert_list_size</var>: is the certificate list size
</p>
<p><var>flags</var>: Flags that may be used to change the verification algorithm. Use OR of the gnutls_certificate_verify_flags enumerations.
</p>
<p><var>voutput</var>: will hold the certificate verification output.
</p>
<p><var>func</var>: If non-null will be called on each chain element verification with the output.
</p>
<p>This function will try to verify the given certificate and return
its status. The <code>voutput</code> parameter will hold an OR’ed sequence of
<code>gnutls_certificate_status_t</code> flags.
</p>
<p>The details of the verification are the same as in <code>gnutls_x509_trust_list_verify_crt2()</code> .
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code> (0) is returned, otherwise a
negative error value.
</p>
<p><strong>Since:</strong> 3.0
</p></dd></dl>
<dl>
<dt><a name="index-gnutls_005fx509_005ftrust_005flist_005fverify_005fcrt2"></a>Function: <em>int</em> <strong>gnutls_x509_trust_list_verify_crt2</strong> <em>(gnutls_x509_trust_list_t <var>list</var>, gnutls_x509_crt_t * <var>cert_list</var>, unsigned int <var>cert_list_size</var>, gnutls_typed_vdata_st * <var>data</var>, unsigned int <var>elements</var>, unsigned int <var>flags</var>, unsigned int * <var>voutput</var>, gnutls_verify_output_function <var>func</var>)</em></dt>
<dd><p><var>list</var>: The list
</p>
<p><var>cert_list</var>: is the certificate list to be verified
</p>
<p><var>cert_list_size</var>: is the certificate list size
</p>
<p><var>data</var>: an array of typed data
</p>
<p><var>elements</var>: the number of data elements
</p>
<p><var>flags</var>: Flags that may be used to change the verification algorithm. Use OR of the gnutls_certificate_verify_flags enumerations.
</p>
<p><var>voutput</var>: will hold the certificate verification output.
</p>
<p><var>func</var>: If non-null will be called on each chain element verification with the output.
</p>
<p>This function will attempt to verify the given certificate and return
its status. The <code>voutput</code> parameter will hold an OR’ed sequence of
<code>gnutls_certificate_status_t</code> flags. When a chain of <code>cert_list_size</code> with
more than one certificates is provided, the verification status will apply
to the first certificate in the chain that failed verification. The
verification process starts from the end of the chain (from CA to end
certificate).
</p>
<p>Additionally a certificate verification profile can be specified
from the ones in <code>gnutls_certificate_verification_profiles_t</code> by
ORing the result of <code>GNUTLS_PROFILE_TO_VFLAGS()</code> to the verification
flags.
</p>
<p>The acceptable <code>data</code> types are <code>GNUTLS_DT_DNS_HOSTNAME</code> and <code>GNUTLS_DT_KEY_PURPOSE_OID</code> .
The former accepts as data a null-terminated hostname, and the latter a null-terminated
object identifier (e.g., <code>GNUTLS_KP_TLS_WWW_SERVER</code> ).
If a DNS hostname is provided then this function will compare
the hostname in the certificate against the given. If names do not match the
<code>GNUTLS_CERT_UNEXPECTED_OWNER</code> status flag will be set. In addition it
will consider certificates provided with <code>gnutls_x509_trust_list_add_named_crt()</code> .
</p>
<p>If a key purpose OID is provided and the end-certificate contains the extended key
usage PKIX extension, it will be required to match the provided OID
or be marked for any purpose, otherwise verification will fail with
<code>GNUTLS_CERT_PURPOSE_MISMATCH</code> status.
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code> (0) is returned, otherwise a
negative error value. Note that verification failure will not result to an
error code, only <code>voutput</code> will be updated.
</p>
<p><strong>Since:</strong> 3.3.8
</p></dd></dl>
<dl>
<dt><a name="index-gnutls_005fx509_005ftrust_005flist_005fverify_005fnamed_005fcrt"></a>Function: <em>int</em> <strong>gnutls_x509_trust_list_verify_named_crt</strong> <em>(gnutls_x509_trust_list_t <var>list</var>, gnutls_x509_crt_t <var>cert</var>, const void * <var>name</var>, size_t <var>name_size</var>, unsigned int <var>flags</var>, unsigned int * <var>voutput</var>, gnutls_verify_output_function <var>func</var>)</em></dt>
<dd><p><var>list</var>: The list
</p>
<p><var>cert</var>: is the certificate to be verified
</p>
<p><var>name</var>: is the certificate’s name
</p>
<p><var>name_size</var>: is the certificate’s name size
</p>
<p><var>flags</var>: Flags that may be used to change the verification algorithm. Use OR of the gnutls_certificate_verify_flags enumerations.
</p>
<p><var>voutput</var>: will hold the certificate verification output.
</p>
<p><var>func</var>: If non-null will be called on each chain element verification with the output.
</p>
<p>This function will try to find a certificate that is associated with the provided
name –see <code>gnutls_x509_trust_list_add_named_crt()</code> . If a match is found the
certificate is considered valid. In addition to that this function will also
check CRLs. The <code>voutput</code> parameter will hold an OR’ed sequence of
<code>gnutls_certificate_status_t</code> flags.
</p>
<p>Additionally a certificate verification profile can be specified
from the ones in <code>gnutls_certificate_verification_profiles_t</code> by
ORing the result of <code>GNUTLS_PROFILE_TO_VFLAGS()</code> to the verification
flags.
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code> (0) is returned, otherwise a
negative error value.
</p>
<p><strong>Since:</strong> 3.0.0
</p></dd></dl>
<dl>
<dt><a name="index-gnutls_005fx509_005ftrust_005flist_005fadd_005ftrust_005ffile"></a>Function: <em>int</em> <strong>gnutls_x509_trust_list_add_trust_file</strong> <em>(gnutls_x509_trust_list_t <var>list</var>, const char * <var>ca_file</var>, const char * <var>crl_file</var>, gnutls_x509_crt_fmt_t <var>type</var>, unsigned int <var>tl_flags</var>, unsigned int <var>tl_vflags</var>)</em></dt>
<dd><p><var>list</var>: The list
</p>
<p><var>ca_file</var>: A file containing a list of CAs (optional)
</p>
<p><var>crl_file</var>: A file containing a list of CRLs (optional)
</p>
<p><var>type</var>: The format of the certificates
</p>
<p><var>tl_flags</var>: GNUTLS_TL_*
</p>
<p><var>tl_vflags</var>: gnutls_certificate_verify_flags if flags specifies GNUTLS_TL_VERIFY_CRL
</p>
<p>This function will add the given certificate authorities
to the trusted list. PKCS <code>11</code> URLs are also accepted, instead
of files, by this function. A PKCS <code>11</code> URL implies a trust
database (a specially marked module in p11-kit); the URL "pkcs11:"
implies all trust databases in the system. Only a single URL specifying
trust databases can be set; they cannot be stacked with multiple calls.
</p>
<p><strong>Returns:</strong> The number of added elements is returned.
</p>
<p><strong>Since:</strong> 3.1
</p></dd></dl>
<dl>
<dt><a name="index-gnutls_005fx509_005ftrust_005flist_005fadd_005ftrust_005fmem"></a>Function: <em>int</em> <strong>gnutls_x509_trust_list_add_trust_mem</strong> <em>(gnutls_x509_trust_list_t <var>list</var>, const gnutls_datum_t * <var>cas</var>, const gnutls_datum_t * <var>crls</var>, gnutls_x509_crt_fmt_t <var>type</var>, unsigned int <var>tl_flags</var>, unsigned int <var>tl_vflags</var>)</em></dt>
<dd><p><var>list</var>: The list
</p>
<p><var>cas</var>: A buffer containing a list of CAs (optional)
</p>
<p><var>crls</var>: A buffer containing a list of CRLs (optional)
</p>
<p><var>type</var>: The format of the certificates
</p>
<p><var>tl_flags</var>: GNUTLS_TL_*
</p>
<p><var>tl_vflags</var>: gnutls_certificate_verify_flags if flags specifies GNUTLS_TL_VERIFY_CRL
</p>
<p>This function will add the given certificate authorities
to the trusted list.
</p>
<p><strong>Returns:</strong> The number of added elements is returned.
</p>
<p><strong>Since:</strong> 3.1
</p></dd></dl>
<dl>
<dt><a name="index-gnutls_005fx509_005ftrust_005flist_005fadd_005fsystem_005ftrust"></a>Function: <em>int</em> <strong>gnutls_x509_trust_list_add_system_trust</strong> <em>(gnutls_x509_trust_list_t <var>list</var>, unsigned int <var>tl_flags</var>, unsigned int <var>tl_vflags</var>)</em></dt>
<dd><p><var>list</var>: The structure of the list
</p>
<p><var>tl_flags</var>: GNUTLS_TL_*
</p>
<p><var>tl_vflags</var>: gnutls_certificate_verify_flags if flags specifies GNUTLS_TL_VERIFY_CRL
</p>
<p>This function adds the system’s default trusted certificate
authorities to the trusted list. Note that on unsupported systems
this function returns <code>GNUTLS_E_UNIMPLEMENTED_FEATURE</code> .
</p>
<p>This function implies the flag <code>GNUTLS_TL_NO_DUPLICATES</code> .
</p>
<p><strong>Returns:</strong> The number of added elements or a negative error code on error.
</p>
<p><strong>Since:</strong> 3.1
</p></dd></dl>
<p>The verification function will verify a given certificate chain against a list of certificate
authorities and certificate revocation lists, and output
a bit-wise OR of elements of the <code>gnutls_certificate_status_t</code>
enumeration shown in <a href="#gnutls_005fcertificate_005fstatus_005ft">Figure 4.2</a>. The <code>GNUTLS_CERT_INVALID</code> flag
is always set on a verification error and more detailed flags will also be set when appropriate.
</p>
<div class="float"><a name="gnutls_005fcertificate_005fstatus_005ft"></a>
<dl compact="compact">
<dt><code>GNUTLS_CERT_INVALID</code></dt>
<dd><p>The certificate is not signed by one of the
known authorities or the signature is invalid (deprecated by the flags
<code>GNUTLS_CERT_SIGNATURE_FAILURE</code> and <code>GNUTLS_CERT_SIGNER_NOT_FOUND</code> ).
</p></dd>
<dt><code>GNUTLS_CERT_REVOKED</code></dt>
<dd><p>Certificate is revoked by its authority. In X.509 this will be
set only if CRLs are checked.
</p></dd>
<dt><code>GNUTLS_CERT_SIGNER_NOT_FOUND</code></dt>
<dd><p>The certificate’s issuer is not known.
This is the case if the issuer is not included in the trusted certificate list.
</p></dd>
<dt><code>GNUTLS_CERT_SIGNER_NOT_CA</code></dt>
<dd><p>The certificate’s signer was not a CA. This
may happen if this was a version 1 certificate, which is common with
some CAs, or a version 3 certificate without the basic constrains extension.
</p></dd>
<dt><code>GNUTLS_CERT_INSECURE_ALGORITHM</code></dt>
<dd><p>The certificate was signed using an insecure
algorithm such as MD2 or MD5. These algorithms have been broken and
should not be trusted.
</p></dd>
<dt><code>GNUTLS_CERT_NOT_ACTIVATED</code></dt>
<dd><p>The certificate is not yet activated.
</p></dd>
<dt><code>GNUTLS_CERT_EXPIRED</code></dt>
<dd><p>The certificate has expired.
</p></dd>
<dt><code>GNUTLS_CERT_SIGNATURE_FAILURE</code></dt>
<dd><p>The signature verification failed.
</p></dd>
<dt><code>GNUTLS_CERT_REVOCATION_DATA_SUPERSEDED</code></dt>
<dd><p>The revocation data are old and have been superseded.
</p></dd>
<dt><code>GNUTLS_CERT_UNEXPECTED_OWNER</code></dt>
<dd><p>The owner is not the expected one.
</p></dd>
<dt><code>GNUTLS_CERT_REVOCATION_DATA_ISSUED_IN_FUTURE</code></dt>
<dd><p>The revocation data have a future issue date.
</p></dd>
<dt><code>GNUTLS_CERT_SIGNER_CONSTRAINTS_FAILURE</code></dt>
<dd><p>The certificate’s signer constraints were
violated.
</p></dd>
<dt><code>GNUTLS_CERT_MISMATCH</code></dt>
<dd><p>The certificate presented isn’t the expected one (TOFU)
</p></dd>
<dt><code>GNUTLS_CERT_PURPOSE_MISMATCH</code></dt>
<dd><p>The certificate or an intermediate does not match the intended purpose (extended key usage).
</p></dd>
<dt><code>GNUTLS_CERT_MISSING_OCSP_STATUS</code></dt>
<dd><p>The certificate requires the server to send the certifiate status, but no status was received.
</p></dd>
<dt><code>GNUTLS_CERT_INVALID_OCSP_STATUS</code></dt>
<dd><p>The received OCSP status response is invalid.
</p></dd>
</dl>
<div class="float-caption"><p><strong>Figure 4.2: </strong>The <code>gnutls_certificate_status_t</code> enumeration.</p></div></div>
<p>An example of certificate verification is shown in <a href="Verifying-a-certificate.html#ex_002dverify2">ex-verify2</a>.
It is also possible to have a set of certificates that
are trusted for a particular server but not to authorize other certificates.
This purpose is served by the functions <a href="X509-certificate-API.html#gnutls_005fx509_005ftrust_005flist_005fadd_005fnamed_005fcrt">gnutls_x509_trust_list_add_named_crt</a> and <a href="X509-certificate-API.html#gnutls_005fx509_005ftrust_005flist_005fverify_005fnamed_005fcrt">gnutls_x509_trust_list_verify_named_crt</a>.
</p>
<hr>
<div class="header">
<p>
Next: <a href="Verifying-a-certificate-in-the-context-of-TLS-session.html#Verifying-a-certificate-in-the-context-of-TLS-session" accesskey="n" rel="next">Verifying a certificate in the context of TLS session</a>, Previous: <a href="X_002e509-public-and-private-keys.html#X_002e509-public-and-private-keys" accesskey="p" rel="prev">X.509 public and private keys</a>, Up: <a href="X_002e509-certificates.html#X_002e509-certificates" accesskey="u" rel="up">X.509 certificates</a> [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Function-and-Data-Index.html#Function-and-Data-Index" title="Index" rel="index">Index</a>]</p>
</div>
</body>
</html>
|