summaryrefslogtreecommitdiffstats
path: root/upstream/debian-unstable/man3/OCSP_REQUEST_new.3ssl
blob: d31b2cc1bd6c45df508375763eeebe24b28dc7eb (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
.\" -*- mode: troff; coding: utf-8 -*-
.\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43)
.\"
.\" Standard preamble:
.\" ========================================================================
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
..
.de Vb \" Begin verbatim text
.ft CW
.nf
.ne \\$1
..
.de Ve \" End verbatim text
.ft R
.fi
..
.\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>.
.ie n \{\
.    ds C` ""
.    ds C' ""
'br\}
.el\{\
.    ds C`
.    ds C'
'br\}
.\"
.\" Escape single quotes in literal strings from groff's Unicode transform.
.ie \n(.g .ds Aq \(aq
.el       .ds Aq '
.\"
.\" If the F register is >0, we'll generate index entries on stderr for
.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
.\" entries marked with X<> in POD.  Of course, you'll have to process the
.\" output yourself in some meaningful fashion.
.\"
.\" Avoid warning from groff about undefined register 'F'.
.de IX
..
.nr rF 0
.if \n(.g .if rF .nr rF 1
.if (\n(rF:(\n(.g==0)) \{\
.    if \nF \{\
.        de IX
.        tm Index:\\$1\t\\n%\t"\\$2"
..
.        if !\nF==2 \{\
.            nr % 0
.            nr F 2
.        \}
.    \}
.\}
.rr rF
.\" ========================================================================
.\"
.IX Title "OCSP_REQUEST_NEW 3SSL"
.TH OCSP_REQUEST_NEW 3SSL 2024-02-03 3.1.5 OpenSSL
.\" For nroff, turn off justification.  Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
.nh
.SH NAME
OCSP_REQUEST_new, OCSP_REQUEST_free, OCSP_request_add0_id, OCSP_request_sign,
OCSP_request_add1_cert, OCSP_request_onereq_count,
OCSP_request_onereq_get0 \- OCSP request functions
.SH SYNOPSIS
.IX Header "SYNOPSIS"
.Vb 1
\& #include <openssl/ocsp.h>
\&
\& OCSP_REQUEST *OCSP_REQUEST_new(void);
\& void OCSP_REQUEST_free(OCSP_REQUEST *req);
\&
\& OCSP_ONEREQ *OCSP_request_add0_id(OCSP_REQUEST *req, OCSP_CERTID *cid);
\&
\& int OCSP_request_sign(OCSP_REQUEST *req,
\&                       X509 *signer, EVP_PKEY *key, const EVP_MD *dgst,
\&                       STACK_OF(X509) *certs, unsigned long flags);
\&
\& int OCSP_request_add1_cert(OCSP_REQUEST *req, X509 *cert);
\&
\& int OCSP_request_onereq_count(OCSP_REQUEST *req);
\& OCSP_ONEREQ *OCSP_request_onereq_get0(OCSP_REQUEST *req, int i);
.Ve
.SH DESCRIPTION
.IX Header "DESCRIPTION"
\&\fBOCSP_REQUEST_new()\fR allocates and returns an empty \fBOCSP_REQUEST\fR structure.
.PP
\&\fBOCSP_REQUEST_free()\fR frees up the request structure \fBreq\fR.
.PP
\&\fBOCSP_request_add0_id()\fR adds certificate ID \fBcid\fR to \fBreq\fR. It returns
the \fBOCSP_ONEREQ\fR structure added so an application can add additional
extensions to the request. The \fBid\fR parameter \fBMUST NOT\fR be freed up after
the operation.
.PP
\&\fBOCSP_request_sign()\fR signs OCSP request \fBreq\fR using certificate
\&\fBsigner\fR, private key \fBkey\fR, digest \fBdgst\fR and additional certificates
\&\fBcerts\fR. If the \fBflags\fR option \fBOCSP_NOCERTS\fR is set then no certificates
will be included in the request.
.PP
\&\fBOCSP_request_add1_cert()\fR adds certificate \fBcert\fR to request \fBreq\fR. The
application is responsible for freeing up \fBcert\fR after use.
.PP
\&\fBOCSP_request_onereq_count()\fR returns the total number of \fBOCSP_ONEREQ\fR
structures in \fBreq\fR.
.PP
\&\fBOCSP_request_onereq_get0()\fR returns an internal pointer to the \fBOCSP_ONEREQ\fR
contained in \fBreq\fR of index \fBi\fR. The index value \fBi\fR runs from 0 to
OCSP_request_onereq_count(req) \- 1.
.SH "RETURN VALUES"
.IX Header "RETURN VALUES"
\&\fBOCSP_REQUEST_new()\fR returns an empty \fBOCSP_REQUEST\fR structure or \fBNULL\fR if
an error occurred.
.PP
\&\fBOCSP_request_add0_id()\fR returns the \fBOCSP_ONEREQ\fR structure containing \fBcid\fR
or \fBNULL\fR if an error occurred.
.PP
\&\fBOCSP_request_sign()\fR and \fBOCSP_request_add1_cert()\fR return 1 for success and 0
for failure.
.PP
\&\fBOCSP_request_onereq_count()\fR returns the total number of \fBOCSP_ONEREQ\fR
structures in \fBreq\fR and \-1 on error.
.PP
\&\fBOCSP_request_onereq_get0()\fR returns a pointer to an \fBOCSP_ONEREQ\fR structure
or \fBNULL\fR if the index value is out or range.
.SH NOTES
.IX Header "NOTES"
An OCSP request structure contains one or more \fBOCSP_ONEREQ\fR structures
corresponding to each certificate.
.PP
\&\fBOCSP_request_onereq_count()\fR and \fBOCSP_request_onereq_get0()\fR are mainly used by
OCSP responders.
.SH EXAMPLES
.IX Header "EXAMPLES"
Create an \fBOCSP_REQUEST\fR structure for certificate \fBcert\fR with issuer
\&\fBissuer\fR:
.PP
.Vb 2
\& OCSP_REQUEST *req;
\& OCSP_ID *cid;
\&
\& req = OCSP_REQUEST_new();
\& if (req == NULL)
\&    /* error */
\& cid = OCSP_cert_to_id(EVP_sha1(), cert, issuer);
\& if (cid == NULL)
\&    /* error */
\&
\& if (OCSP_REQUEST_add0_id(req, cid) == NULL)
\&    /* error */
\&
\& /* Do something with req, e.g. query responder */
\&
\& OCSP_REQUEST_free(req);
.Ve
.SH "SEE ALSO"
.IX Header "SEE ALSO"
\&\fBcrypto\fR\|(7),
\&\fBOCSP_cert_to_id\fR\|(3),
\&\fBOCSP_request_add1_nonce\fR\|(3),
\&\fBOCSP_resp_find_status\fR\|(3),
\&\fBOCSP_response_status\fR\|(3),
\&\fBOCSP_sendreq_new\fR\|(3)
.SH COPYRIGHT
.IX Header "COPYRIGHT"
Copyright 2015\-2022 The OpenSSL Project Authors. All Rights Reserved.
.PP
Licensed under the Apache License 2.0 (the "License").  You may not use
this file except in compliance with the License.  You can obtain a copy
in the file LICENSE in the source distribution or at
<https://www.openssl.org/source/license.html>.