summaryrefslogtreecommitdiff
path: root/manual/html_node/OCSP-certificate-status-checking.html
blob: 9c5de6611cd8698d725c1cdcacdbd2ace6e6d4a6 (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
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<!-- This manual is last updated 29 July 2014 for version
3.3.10 of GnuTLS.

Copyright (C) 2001-2013 Free Software Foundation, Inc.\\
Copyright (C) 2001-2013 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 5.2, http://www.gnu.org/software/texinfo/ -->
<head>
<title>GnuTLS 3.3.10: OCSP certificate status checking</title>

<meta name="description" content="GnuTLS 3.3.10: OCSP certificate status checking">
<meta name="keywords" content="GnuTLS 3.3.10: OCSP certificate status checking">
<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="More-on-certificate-authentication.html#More-on-certificate-authentication" rel="up" title="More on certificate authentication">
<link href="Managing-encrypted-keys.html#Managing-encrypted-keys" rel="next" title="Managing encrypted keys">
<link href="PKIX-certificate-revocation-lists.html#PKIX-certificate-revocation-lists" rel="prev" title="PKIX certificate revocation lists">
<style type="text/css">
<!--
a.summary-letter {text-decoration: none}
blockquote.smallquotation {font-size: smaller}
div.display {margin-left: 3.2em}
div.example {margin-left: 3.2em}
div.indentedblock {margin-left: 3.2em}
div.lisp {margin-left: 3.2em}
div.smalldisplay {margin-left: 3.2em}
div.smallexample {margin-left: 3.2em}
div.smallindentedblock {margin-left: 3.2em; font-size: smaller}
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.nocodebreak {white-space:nowrap}
span.nolinebreak {white-space:nowrap}
span.roman {font-family:serif; 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;
  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" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
<a name="OCSP-certificate-status-checking"></a>
<div class="header">
<p>
Next: <a href="Managing-encrypted-keys.html#Managing-encrypted-keys" accesskey="n" rel="next">Managing encrypted keys</a>, Previous: <a href="PKIX-certificate-revocation-lists.html#PKIX-certificate-revocation-lists" accesskey="p" rel="prev">PKIX certificate revocation lists</a>, Up: <a href="More-on-certificate-authentication.html#More-on-certificate-authentication" accesskey="u" rel="up">More on certificate authentication</a> &nbsp; [<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="OCSP-certificate-status-checking-1"></a>
<h4 class="subsection">4.2.3 <acronym>OCSP</acronym> certificate status checking</h4>
<a name="index-certificate-status"></a>
<a name="index-Online-Certificate-Status-Protocol"></a>
<a name="index-OCSP"></a>

<p>Certificates may be revoked before their expiration time has been
reached.  There are several reasons for revoking certificates, but a
typical situation is when the private key associated with a
certificate has been compromised.  Traditionally, Certificate
Revocation Lists (CRLs) have been used by application to implement
revocation checking, however, several problems with CRLs have been
identified [<em>RIVESTCRL</em>].
</p>
<p>The Online Certificate Status Protocol, or <acronym>OCSP</acronym> [<em>RFC2560</em>], 
is a widely implemented protocol which performs certificate revocation status
checking.  An application that wish to verify the
identity of a peer will verify the certificate against a set of
trusted certificates and then check whether the certificate is listed
in a CRL and/or perform an OCSP check for the certificate.
</p>
<p>Note that in the context of a TLS session the server may provide an
OCSP response that will be used during the TLS certificate verification
(see <a href="Core-TLS-API.html#gnutls_005fcertificate_005fverify_005fpeers2">gnutls_certificate_verify_peers2</a>).
You may obtain this response using <a href="Core-TLS-API.html#gnutls_005focsp_005fstatus_005frequest_005fget">gnutls_ocsp_status_request_get</a>.
</p>
<p>Before performing the OCSP query, the application will need to figure
out the address of the OCSP server.  The OCSP server address can be
provided by the local user in manual configuration or may be stored
in the certificate that is being checked.  When stored in a certificate
the OCSP server is in the extension field called the Authority Information 
Access (AIA). The following function
extracts this information from a certificate.
</p>
<dl compact="compact">
<dt><code><var>int</var> <a href="X509-certificate-API.html#gnutls_005fx509_005fcrt_005fget_005fauthority_005finfo_005faccess">gnutls_x509_crt_get_authority_info_access</a> (gnutls_x509_crt_t <var>crt</var>, unsigned int <var>seq</var>, int <var>what</var>, gnutls_datum_t * <var>data</var>, unsigned int * <var>critical</var>)</code></dt>
</dl>

<p>There are several functions in GnuTLS for creating and manipulating
OCSP requests and responses.  The general idea is that a client
application creates an OCSP request object, stores some information
about the certificate to check in the request, and then exports the
request in DER format.  The request will then need to be sent to the
OCSP responder, which needs to be done by the application (GnuTLS does
not send and receive OCSP packets).  Normally an OCSP response is
received that the application will need to import into an OCSP
response object.  The digital signature in the OCSP response needs to
be verified against a set of trust anchors before the information in
the response can be trusted.
</p>
<p>The ASN.1 structure of OCSP requests are briefly as follows.  It is
useful to review the structures to get an understanding of which
fields are modified by GnuTLS functions.
</p>
<div class="example">
<pre class="example">OCSPRequest     ::=     SEQUENCE {
    tbsRequest                  TBSRequest,
    optionalSignature   [0]     EXPLICIT Signature OPTIONAL }

TBSRequest      ::=     SEQUENCE {
    version             [0]     EXPLICIT Version DEFAULT v1,
    requestorName       [1]     EXPLICIT GeneralName OPTIONAL,
    requestList                 SEQUENCE OF Request,
    requestExtensions   [2]     EXPLICIT Extensions OPTIONAL }

Request         ::=     SEQUENCE {
    reqCert                     CertID,
    singleRequestExtensions     [0] EXPLICIT Extensions OPTIONAL }

CertID          ::=     SEQUENCE {
    hashAlgorithm       AlgorithmIdentifier,
    issuerNameHash      OCTET STRING, -- Hash of Issuer's DN
    issuerKeyHash       OCTET STRING, -- Hash of Issuers public key
    serialNumber        CertificateSerialNumber }
</pre></div>

<p>The basic functions to initialize, import, export and deallocate OCSP
requests are the following.
</p>
<dl compact="compact">
<dt><code><var>int</var> <a href="OCSP-API.html#gnutls_005focsp_005freq_005finit">gnutls_ocsp_req_init</a> (gnutls_ocsp_req_t * <var>req</var>)</code></dt>
<dt><code><var>void</var> <a href="OCSP-API.html#gnutls_005focsp_005freq_005fdeinit">gnutls_ocsp_req_deinit</a> (gnutls_ocsp_req_t <var>req</var>)</code></dt>
<dt><code><var>int</var> <a href="OCSP-API.html#gnutls_005focsp_005freq_005fimport">gnutls_ocsp_req_import</a> (gnutls_ocsp_req_t <var>req</var>, const gnutls_datum_t * <var>data</var>)</code></dt>
<dt><code><var>int</var> <a href="OCSP-API.html#gnutls_005focsp_005freq_005fexport">gnutls_ocsp_req_export</a> (gnutls_ocsp_req_t <var>req</var>, gnutls_datum_t * <var>data</var>)</code></dt>
<dt><code><var>int</var> <a href="OCSP-API.html#gnutls_005focsp_005freq_005fprint">gnutls_ocsp_req_print</a> (gnutls_ocsp_req_t <var>req</var>, gnutls_ocsp_print_formats_t <var>format</var>, gnutls_datum_t * <var>out</var>)</code></dt>
</dl>

<p>To generate an OCSP request the issuer name hash, issuer key hash, and 
the checked certificate&rsquo;s serial number are required. There are two
interfaces available for setting those in an OCSP request.
The is a low-level function when you have the
issuer name hash, issuer key hash, and certificate serial number in
binary form.  The second is more useful if you have the
certificate (and its issuer) in a <code>gnutls_x509_crt_t</code> type.
There is also a function to extract this information from existing an OCSP
request.
</p>
<dl compact="compact">
<dt><code><var>int</var> <a href="OCSP-API.html#gnutls_005focsp_005freq_005fadd_005fcert_005fid">gnutls_ocsp_req_add_cert_id</a> (gnutls_ocsp_req_t <var>req</var>, gnutls_digest_algorithm_t <var>digest</var>, const gnutls_datum_t * <var>issuer_name_hash</var>, const gnutls_datum_t * <var>issuer_key_hash</var>, const gnutls_datum_t * <var>serial_number</var>)</code></dt>
<dt><code><var>int</var> <a href="OCSP-API.html#gnutls_005focsp_005freq_005fadd_005fcert">gnutls_ocsp_req_add_cert</a> (gnutls_ocsp_req_t <var>req</var>, gnutls_digest_algorithm_t <var>digest</var>, gnutls_x509_crt_t <var>issuer</var>, gnutls_x509_crt_t <var>cert</var>)</code></dt>
<dt><code><var>int</var> <a href="OCSP-API.html#gnutls_005focsp_005freq_005fget_005fcert_005fid">gnutls_ocsp_req_get_cert_id</a> (gnutls_ocsp_req_t <var>req</var>, unsigned <var>indx</var>, gnutls_digest_algorithm_t * <var>digest</var>, gnutls_datum_t * <var>issuer_name_hash</var>, gnutls_datum_t * <var>issuer_key_hash</var>, gnutls_datum_t * <var>serial_number</var>)</code></dt>
</dl>

<p>Each OCSP request may contain a number of extensions.  Extensions are
identified by an Object Identifier (OID) and an opaque data buffer
whose syntax and semantics is implied by the OID. You can extract or
set those extensions using the following functions.
</p>
<dl compact="compact">
<dt><code><var>int</var> <a href="OCSP-API.html#gnutls_005focsp_005freq_005fget_005fextension">gnutls_ocsp_req_get_extension</a> (gnutls_ocsp_req_t <var>req</var>, unsigned <var>indx</var>, gnutls_datum_t * <var>oid</var>, unsigned int * <var>critical</var>, gnutls_datum_t * <var>data</var>)</code></dt>
<dt><code><var>int</var> <a href="OCSP-API.html#gnutls_005focsp_005freq_005fset_005fextension">gnutls_ocsp_req_set_extension</a> (gnutls_ocsp_req_t <var>req</var>, const char * <var>oid</var>, unsigned int <var>critical</var>, const gnutls_datum_t * <var>data</var>)</code></dt>
</dl>

<p>A common OCSP Request extension is the nonce extension (OID
1.3.6.1.5.5.7.48.1.2), which is used to avoid replay attacks of
earlier recorded OCSP responses.  The nonce extension carries a value
that is intended to be sufficiently random and unique so that an
attacker will not be able to give a stale response for the same nonce.
</p>
<dl compact="compact">
<dt><code><var>int</var> <a href="OCSP-API.html#gnutls_005focsp_005freq_005fget_005fnonce">gnutls_ocsp_req_get_nonce</a> (gnutls_ocsp_req_t <var>req</var>, unsigned int * <var>critical</var>, gnutls_datum_t * <var>nonce</var>)</code></dt>
<dt><code><var>int</var> <a href="OCSP-API.html#gnutls_005focsp_005freq_005fset_005fnonce">gnutls_ocsp_req_set_nonce</a> (gnutls_ocsp_req_t <var>req</var>, unsigned int <var>critical</var>, const gnutls_datum_t * <var>nonce</var>)</code></dt>
<dt><code><var>int</var> <a href="OCSP-API.html#gnutls_005focsp_005freq_005frandomize_005fnonce">gnutls_ocsp_req_randomize_nonce</a> (gnutls_ocsp_req_t <var>req</var>)</code></dt>
</dl>

<p>The OCSP response structures is a complex structure. A simplified overview
of it is in <a href="#tab_003aocsp_002dresponse">Table 4.8</a>. Note that a response may contain 
information on multiple certificates.
</p>
<div class="float"><a name="tab_003aocsp_002dresponse"></a>
<table>
<thead><tr><th width="20%">Field</th><th width="70%">Description</th></tr></thead>
<tr><td width="20%">version</td><td width="70%">The OCSP response version number (typically 1).</td></tr>
<tr><td width="20%">responder ID</td><td width="70%">An identifier of the responder (DN name or a hash of its key).</td></tr>
<tr><td width="20%">issue time</td><td width="70%">The time the response was generated.</td></tr>
<tr><td width="20%">thisUpdate</td><td width="70%">The issuing time of the revocation information.</td></tr>
<tr><td width="20%">nextUpdate</td><td width="70%">The issuing time of the revocation information that will update that one.</td></tr>
<tr><td width="20%"></td><td width="70%">Revoked certificates</td></tr>
<tr><td width="20%">certificate status</td><td width="70%">The status of the certificate.</td></tr>
<tr><td width="20%">certificate serial</td><td width="70%">The certificate&rsquo;s serial number.</td></tr>
<tr><td width="20%">revocationTime</td><td width="70%">The time the certificate was revoked.</td></tr>
<tr><td width="20%">revocationReason</td><td width="70%">The reason the certificate was revoked.</td></tr>
</table>

<div class="float-caption"><p><strong>Table 4.8: </strong>The most important OCSP response fields.</p></div></div>

<p>We provide basic functions for initialization, importing, exporting
and deallocating OCSP responses.  
</p>
<dl compact="compact">
<dt><code><var>int</var> <a href="OCSP-API.html#gnutls_005focsp_005fresp_005finit">gnutls_ocsp_resp_init</a> (gnutls_ocsp_resp_t * <var>resp</var>)</code></dt>
<dt><code><var>void</var> <a href="OCSP-API.html#gnutls_005focsp_005fresp_005fdeinit">gnutls_ocsp_resp_deinit</a> (gnutls_ocsp_resp_t <var>resp</var>)</code></dt>
<dt><code><var>int</var> <a href="OCSP-API.html#gnutls_005focsp_005fresp_005fimport">gnutls_ocsp_resp_import</a> (gnutls_ocsp_resp_t <var>resp</var>, const gnutls_datum_t * <var>data</var>)</code></dt>
<dt><code><var>int</var> <a href="OCSP-API.html#gnutls_005focsp_005fresp_005fexport">gnutls_ocsp_resp_export</a> (gnutls_ocsp_resp_t <var>resp</var>, gnutls_datum_t * <var>data</var>)</code></dt>
<dt><code><var>int</var> <a href="OCSP-API.html#gnutls_005focsp_005fresp_005fprint">gnutls_ocsp_resp_print</a> (gnutls_ocsp_resp_t <var>resp</var>, gnutls_ocsp_print_formats_t <var>format</var>, gnutls_datum_t * <var>out</var>)</code></dt>
</dl>

<p>The utility function that extracts the revocation as well as other information
from a response is shown below.
</p>




<dl>
<dt><a name="index-gnutls_005focsp_005fresp_005fget_005fsingle"></a>Function: <em>int</em> <strong>gnutls_ocsp_resp_get_single</strong> <em>(gnutls_ocsp_resp_t <var>resp</var>, unsigned <var>indx</var>, gnutls_digest_algorithm_t * <var>digest</var>, gnutls_datum_t * <var>issuer_name_hash</var>, gnutls_datum_t * <var>issuer_key_hash</var>, gnutls_datum_t * <var>serial_number</var>, unsigned int * <var>cert_status</var>, time_t * <var>this_update</var>, time_t * <var>next_update</var>, time_t * <var>revocation_time</var>, unsigned int * <var>revocation_reason</var>)</em></dt>
<dd><p><var>resp</var>: should contain a <code>gnutls_ocsp_resp_t</code>  structure
</p>
<p><var>indx</var>: Specifies response number to get. Use (0) to get the first one.
</p>
<p><var>digest</var>: output variable with <code>gnutls_digest_algorithm_t</code>  hash algorithm
</p>
<p><var>issuer_name_hash</var>: output buffer with hash of issuer&rsquo;s DN
</p>
<p><var>issuer_key_hash</var>: output buffer with hash of issuer&rsquo;s public key
</p>
<p><var>serial_number</var>: output buffer with serial number of certificate to check
</p>
<p><var>cert_status</var>: a certificate status, a <code>gnutls_ocsp_cert_status_t</code>  enum.
</p>
<p><var>this_update</var>: time at which the status is known to be correct.
</p>
<p><var>next_update</var>: when newer information will be available, or (time_t)-1 if unspecified
</p>
<p><var>revocation_time</var>: when  <code>cert_status</code> is <code>GNUTLS_OCSP_CERT_REVOKED</code> , holds time of revocation.
</p>
<p><var>revocation_reason</var>: revocation reason, a <code>gnutls_x509_crl_reason_t</code>  enum.
</p>
<p>This function will return the certificate information of the
 <code>indx</code> &rsquo;ed response in the Basic OCSP Response  <code>resp</code> .  The
information returned corresponds to the OCSP SingleResponse structure
except the final singleExtensions.
</p>
<p>Each of the pointers to output variables may be NULL to indicate
that the caller is not interested in that value.
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a
negative error code is returned.  If you have reached the last
CertID available <code>GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE</code>  will be
returned.
</p></dd></dl>

<p>The possible revocation reasons available in an OCSP response are shown
below.
</p>
<div class="float"><a name="gnutls_005fx509_005fcrl_005freason_005ft"></a>


<dl compact="compact">
<dt><code>GNUTLS_X509_CRLREASON_UNSPECIFIED</code></dt>
<dd><p>Unspecified reason.
</p></dd>
<dt><code>GNUTLS_X509_CRLREASON_KEYCOMPROMISE</code></dt>
<dd><p>Private key compromised.
</p></dd>
<dt><code>GNUTLS_X509_CRLREASON_CACOMPROMISE</code></dt>
<dd><p>CA compromised.
</p></dd>
<dt><code>GNUTLS_X509_CRLREASON_AFFILIATIONCHANGED</code></dt>
<dd><p>Affiliation has changed.
</p></dd>
<dt><code>GNUTLS_X509_CRLREASON_SUPERSEDED</code></dt>
<dd><p>Certificate superseded.
</p></dd>
<dt><code>GNUTLS_X509_CRLREASON_CESSATIONOFOPERATION</code></dt>
<dd><p>Operation has ceased.
</p></dd>
<dt><code>GNUTLS_X509_CRLREASON_CERTIFICATEHOLD</code></dt>
<dd><p>Certificate is on hold.
</p></dd>
<dt><code>GNUTLS_X509_CRLREASON_REMOVEFROMCRL</code></dt>
<dd><p>Will be removed from delta CRL.
</p></dd>
<dt><code>GNUTLS_X509_CRLREASON_PRIVILEGEWITHDRAWN</code></dt>
<dd><p>Privilege withdrawn.
</p></dd>
<dt><code>GNUTLS_X509_CRLREASON_AACOMPROMISE</code></dt>
<dd><p>AA compromised.
</p></dd>
</dl>

<div class="float-caption"><p><strong>Figure 4.5: </strong>The revocation reasons</p></div></div>
<p>Note, that the OCSP response needs to be verified against some set of trust
anchors before it can be relied upon. It is also important to check
whether the received OCSP response corresponds to the certificate being checked.
</p>
<dl compact="compact">
<dt><code><var>int</var> <a href="OCSP-API.html#gnutls_005focsp_005fresp_005fverify">gnutls_ocsp_resp_verify</a> (gnutls_ocsp_resp_t <var>resp</var>, gnutls_x509_trust_list_t <var>trustlist</var>, unsigned int * <var>verify</var>, unsigned int <var>flags</var>)</code></dt>
<dt><code><var>int</var> <a href="OCSP-API.html#gnutls_005focsp_005fresp_005fverify_005fdirect">gnutls_ocsp_resp_verify_direct</a> (gnutls_ocsp_resp_t <var>resp</var>, gnutls_x509_crt_t <var>issuer</var>, unsigned int * <var>verify</var>, unsigned int <var>flags</var>)</code></dt>
<dt><code><var>int</var> <a href="OCSP-API.html#gnutls_005focsp_005fresp_005fcheck_005fcrt">gnutls_ocsp_resp_check_crt</a> (gnutls_ocsp_resp_t <var>resp</var>, unsigned int <var>indx</var>, gnutls_x509_crt_t <var>crt</var>)</code></dt>
</dl>

<hr>
<div class="header">
<p>
Next: <a href="Managing-encrypted-keys.html#Managing-encrypted-keys" accesskey="n" rel="next">Managing encrypted keys</a>, Previous: <a href="PKIX-certificate-revocation-lists.html#PKIX-certificate-revocation-lists" accesskey="p" rel="prev">PKIX certificate revocation lists</a>, Up: <a href="More-on-certificate-authentication.html#More-on-certificate-authentication" accesskey="u" rel="up">More on certificate authentication</a> &nbsp; [<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>