summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/man/OCSP_REQUEST_new.3
diff options
context:
space:
mode:
authorschwarze <>2016-11-27 20:40:07 +0000
committerschwarze <>2016-11-27 20:40:07 +0000
commit2613b464a5e73671df478b07cbb7bb84c6ceea0d (patch)
tree37809d727204ff4a84215c775599f31426aed275 /src/lib/libcrypto/man/OCSP_REQUEST_new.3
parent9dfb65eab2197f3d5d42b3a11527c846bb6c584c (diff)
downloadopenbsd-2613b464a5e73671df478b07cbb7bb84c6ceea0d.tar.gz
openbsd-2613b464a5e73671df478b07cbb7bb84c6ceea0d.tar.bz2
openbsd-2613b464a5e73671df478b07cbb7bb84c6ceea0d.zip
Import OCSP documentation from OpenSSL, leaving out some stuff
that we don't have, fixing some bugs and tweaking some parts for readability. P.S. Why did some people write a HTTP client implementation and then decide that the best place to publish it might be a crypto(3) library? Oh never mind, to go easy on my sanity, i should probably stop asking such questions and just document what i find.
Diffstat (limited to 'src/lib/libcrypto/man/OCSP_REQUEST_new.3')
-rw-r--r--src/lib/libcrypto/man/OCSP_REQUEST_new.3241
1 files changed, 241 insertions, 0 deletions
diff --git a/src/lib/libcrypto/man/OCSP_REQUEST_new.3 b/src/lib/libcrypto/man/OCSP_REQUEST_new.3
new file mode 100644
index 0000000000..dd08b7c2ca
--- /dev/null
+++ b/src/lib/libcrypto/man/OCSP_REQUEST_new.3
@@ -0,0 +1,241 @@
1.\" $OpenBSD: OCSP_REQUEST_new.3,v 1.1 2016/11/27 20:40:07 schwarze Exp $
2.\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100
3.\"
4.\" This file was written by Dr. Stephen Henson <steve@openssl.org>.
5.\" Copyright (c) 2014, 2016 The OpenSSL Project. All rights reserved.
6.\"
7.\" Redistribution and use in source and binary forms, with or without
8.\" modification, are permitted provided that the following conditions
9.\" are met:
10.\"
11.\" 1. Redistributions of source code must retain the above copyright
12.\" notice, this list of conditions and the following disclaimer.
13.\"
14.\" 2. Redistributions in binary form must reproduce the above copyright
15.\" notice, this list of conditions and the following disclaimer in
16.\" the documentation and/or other materials provided with the
17.\" distribution.
18.\"
19.\" 3. All advertising materials mentioning features or use of this
20.\" software must display the following acknowledgment:
21.\" "This product includes software developed by the OpenSSL Project
22.\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
23.\"
24.\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
25.\" endorse or promote products derived from this software without
26.\" prior written permission. For written permission, please contact
27.\" openssl-core@openssl.org.
28.\"
29.\" 5. Products derived from this software may not be called "OpenSSL"
30.\" nor may "OpenSSL" appear in their names without prior written
31.\" permission of the OpenSSL Project.
32.\"
33.\" 6. Redistributions of any form whatsoever must retain the following
34.\" acknowledgment:
35.\" "This product includes software developed by the OpenSSL Project
36.\" for use in the OpenSSL Toolkit (http://www.openssl.org/)"
37.\"
38.\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
39.\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
40.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
41.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
42.\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
43.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
44.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
45.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
46.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
47.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
48.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
49.\" OF THE POSSIBILITY OF SUCH DAMAGE.
50.\"
51.Dd $Mdocdate: November 27 2016 $
52.Dt OCSP_REQUEST_NEW 3
53.Os
54.Sh NAME
55.Nm OCSP_REQUEST_new ,
56.Nm OCSP_REQUEST_free ,
57.Nm OCSP_request_add0_id ,
58.Nm OCSP_request_sign ,
59.Nm OCSP_request_add1_cert ,
60.Nm OCSP_request_onereq_count ,
61.Nm OCSP_request_onereq_get0 ,
62.Nd OCSP request functions
63.Sh SYNOPSIS
64.In openssl/ocsp.h
65.Ft OCSP_REQUEST *
66.Fn OCSP_REQUEST_new void
67.Ft void
68.Fo OCSP_REQUEST_free
69.Fa "OCSP_REQUEST *req"
70.Fc
71.Ft OCSP_ONEREQ *
72.Fo OCSP_request_add0_id
73.Fa "OCSP_REQUEST *req"
74.Fa "OCSP_CERTID *cid"
75.Fc
76.Ft int
77.Fo OCSP_request_sign
78.Fa "OCSP_REQUEST *req"
79.Fa "X509 *signer"
80.Fa "EVP_PKEY *key"
81.Fa "const EVP_MD *dgst"
82.Fa "STACK_OF(X509) *certs"
83.Fa "unsigned long flags"
84.Fc
85.Ft int
86.Fo OCSP_request_add1_cert
87.Fa "OCSP_REQUEST *req"
88.Fa "X509 *cert"
89.Fc
90.Ft int
91.Fo OCSP_request_onereq_count
92.Fa "OCSP_REQUEST *req"
93.Fc
94.Ft OCSP_ONEREQ *
95.Fo OCSP_request_onereq_get0
96.Fa "OCSP_REQUEST *req"
97.Fa "int i"
98.Fc
99.Sh DESCRIPTION
100.Fn OCSP_REQUEST_new
101allocates and returns an empty
102.Vt OCSP_REQUEST
103structure.
104.Pp
105.Fn OCSP_REQUEST_free
106frees up the request structure
107.Fa req .
108.Pp
109.Fn OCSP_request_add0_id
110adds certificate ID
111.Fa cid
112to
113.Fa req .
114It returns the
115.Vt OCSP_ONEREQ
116structure added so an application can add additional extensions to the
117request.
118The
119.Fa cid
120parameter must not be freed up after the operation.
121.Pp
122.Fn OCSP_request_sign
123signs OCSP request
124.Fa req
125using certificate
126.Fa signer ,
127private key
128.Fa key ,
129digest
130.Fa dgst ,
131and additional certificates
132.Fa certs .
133If the
134.Fa flags
135option
136.Dv OCSP_NOCERTS
137is set, then no certificates will be included in the request.
138.Pp
139.Fn OCSP_request_add1_cert
140adds certificate
141.Fa cert
142to request
143.Fa req .
144The application is responsible for freeing up
145.Fa cert
146after use.
147.Pp
148.Fn OCSP_request_onereq_count
149returns the total number of
150.Vt OCSP_ONEREQ
151structures in
152.Fa req .
153.Pp
154.Fn OCSP_request_onereq_get0
155returns an internal pointer to the
156.Vt OCSP_ONEREQ
157contained in
158.Fa req
159of index
160.Fa i .
161The index value
162.Fa i
163runs from 0 to
164.Fn OCSP_request_onereq_count req No - 1 .
165.Pp
166An
167.Vt OCSP_REQUEST
168structure contains one or more
169.Vt OCSP_ONEREQ
170structures corresponding to each certificate.
171.Pp
172.Fn OCSP_request_onereq_count
173and
174.Fn OCSP_request_onereq_get0
175are mainly used by OCSP responders.
176.Sh RETURN VALUES
177.Fn OCSP_REQUEST_new
178returns an empty
179.Vt OCSP_REQUEST
180structure or
181.Dv NULL
182if an error occurred.
183.Pp
184.Fn OCSP_request_add0_id
185returns the
186.Vt OCSP_ONEREQ
187structure containing
188.Fa cid
189or
190.Dv NULL
191if an error occurred.
192.Pp
193.Fn OCSP_request_sign
194and
195.Fn OCSP_request_add1_cert
196return 1 for success or 0 for failure.
197.Pp
198.Fn OCSP_request_onereq_count
199returns the total number of
200.Vt OCSP_ONEREQ
201structures in
202.Fa req .
203.Pp
204.Fn OCSP_request_onereq_get0
205returns a pointer to an
206.Vt OCSP_ONEREQ
207structure or
208.Dv NULL
209if the index value is out or range.
210.Sh EXAMPLE
211Create an
212.Vt OCSP_REQUEST
213structure for certificate
214.Fa cert
215with issuer
216.Fa issuer :
217.Bd -literal -offset indent
218OCSP_REQUEST *req;
219OCSP_ID *cid;
220
221req = OCSP_REQUEST_new();
222if (req == NULL)
223 /* error */
224cid = OCSP_cert_to_id(EVP_sha1(), cert, issuer);
225if (cid == NULL)
226 /* error */
227
228if (OCSP_REQUEST_add0_id(req, cid) == NULL)
229 /* error */
230
231 /* Do something with req, e.g. query responder */
232
233OCSP_REQUEST_free(req);
234.Ed
235.Sh SEE ALSO
236.Xr crypto 3 ,
237.Xr OCSP_cert_to_id 3 ,
238.Xr OCSP_request_add1_nonce 3 ,
239.Xr OCSP_resp_find_status 3 ,
240.Xr OCSP_response_status 3 ,
241.Xr OCSP_sendreq_new 3