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
|
.\" $OpenBSD: d2i_OCSP_RESPONSE.3,v 1.2 2018/03/22 21:08:22 schwarze Exp $
.\"
.\" Copyright (c) 2016 Ingo Schwarze <schwarze@openbsd.org>
.\"
.\" Permission to use, copy, modify, and distribute this software for any
.\" purpose with or without fee is hereby granted, provided that the above
.\" copyright notice and this permission notice appear in all copies.
.\"
.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
.Dd $Mdocdate: March 22 2018 $
.Dt D2I_OCSP_RESPONSE 3
.Os
.Sh NAME
.Nm d2i_OCSP_RESPONSE ,
.Nm i2d_OCSP_RESPONSE ,
.Nm d2i_OCSP_RESPBYTES ,
.Nm i2d_OCSP_RESPBYTES ,
.Nm d2i_OCSP_BASICRESP ,
.Nm i2d_OCSP_BASICRESP ,
.Nm d2i_OCSP_RESPDATA ,
.Nm i2d_OCSP_RESPDATA ,
.Nm d2i_OCSP_RESPID ,
.Nm i2d_OCSP_RESPID ,
.Nm d2i_OCSP_SINGLERESP ,
.Nm i2d_OCSP_SINGLERESP ,
.Nm d2i_OCSP_CERTSTATUS ,
.Nm i2d_OCSP_CERTSTATUS ,
.Nm d2i_OCSP_REVOKEDINFO ,
.Nm i2d_OCSP_REVOKEDINFO ,
.Nm d2i_OCSP_CRLID ,
.Nm i2d_OCSP_CRLID
.Nd decode and encode OCSP responses
.Sh SYNOPSIS
.In openssl/ocsp.h
.Ft OCSP_RESPONSE *
.Fo d2i_OCSP_RESPONSE
.Fa "OCSP_RESPONSE **val_out"
.Fa "const unsigned char **der_in"
.Fa "long length"
.Fc
.Ft int
.Fo i2d_OCSP_RESPONSE
.Fa "OCSP_RESPONSE *val_in"
.Fa "unsigned char **der_out"
.Fc
.Ft OCSP_RESPBYTES *
.Fo d2i_OCSP_RESPBYTES
.Fa "OCSP_RESPBYTES **val_out"
.Fa "const unsigned char **der_in"
.Fa "long length"
.Fc
.Ft int
.Fo i2d_OCSP_RESPBYTES
.Fa "OCSP_RESPBYTES *val_in"
.Fa "unsigned char **der_out"
.Fc
.Ft OCSP_BASICRESP *
.Fo d2i_OCSP_BASICRESP
.Fa "OCSP_BASICRESP **val_out"
.Fa "const unsigned char **der_in"
.Fa "long length"
.Fc
.Ft int
.Fo i2d_OCSP_BASICRESP
.Fa "OCSP_BASICRESP *val_in"
.Fa "unsigned char **der_out"
.Fc
.Ft OCSP_RESPDATA *
.Fo d2i_OCSP_RESPDATA
.Fa "OCSP_RESPDATA **val_out"
.Fa "const unsigned char **der_in"
.Fa "long length"
.Fc
.Ft int
.Fo i2d_OCSP_RESPDATA
.Fa "OCSP_RESPDATA *val_in"
.Fa "unsigned char **der_out"
.Fc
.Ft OCSP_RESPID *
.Fo d2i_OCSP_RESPID
.Fa "OCSP_RESPID **val_out"
.Fa "const unsigned char **der_in"
.Fa "long length"
.Fc
.Ft int
.Fo i2d_OCSP_RESPID
.Fa "OCSP_RESPID *val_in"
.Fa "unsigned char **der_out"
.Fc
.Ft OCSP_SINGLERESP *
.Fo d2i_OCSP_SINGLERESP
.Fa "OCSP_SINGLERESP **val_out"
.Fa "const unsigned char **der_in"
.Fa "long length"
.Fc
.Ft int
.Fo i2d_OCSP_SINGLERESP
.Fa "OCSP_SINGLERESP *val_in"
.Fa "unsigned char **der_out"
.Fc
.Ft OCSP_CERTSTATUS *
.Fo d2i_OCSP_CERTSTATUS
.Fa "OCSP_CERTSTATUS **val_out"
.Fa "const unsigned char **der_in"
.Fa "long length"
.Fc
.Ft int
.Fo i2d_OCSP_CERTSTATUS
.Fa "OCSP_CERTSTATUS *val_in"
.Fa "unsigned char **der_out"
.Fc
.Ft OCSP_REVOKEDINFO *
.Fo d2i_OCSP_REVOKEDINFO
.Fa "OCSP_REVOKEDINFO **val_out"
.Fa "const unsigned char **der_in"
.Fa "long length"
.Fc
.Ft int
.Fo i2d_OCSP_REVOKEDINFO
.Fa "OCSP_REVOKEDINFO *val_in"
.Fa "unsigned char **der_out"
.Fc
.Ft OCSP_CRLID *
.Fo d2i_OCSP_CRLID
.Fa "OCSP_CRLID **val_out"
.Fa "const unsigned char **der_in"
.Fa "long length"
.Fc
.Ft int
.Fo i2d_OCSP_CRLID
.Fa "OCSP_CRLID *val_in"
.Fa "unsigned char **der_out"
.Fc
.Sh DESCRIPTION
Theses functions decode and encode ASN.1 structures used for OCSP
responses.
For details about the semantics, examples, caveats, and bugs, see
.Xr ASN1_item_d2i 3 .
.Pp
.Fn d2i_OCSP_RESPONSE
and
.Fn i2d_OCSP_RESPONSE
decode and encode an ASN.1
.Vt OCSPResponse
structure defined in RFC 6960 section 4.2.1.
.Pp
.Fn d2i_OCSP_RESPBYTES
and
.Fn i2d_OCSP_RESPBYTES
decode and encode an ASN.1
.Vt ResponseBytes
structure defined in RFC 6960 section 4.2.1.
.Pp
.Fn d2i_OCSP_BASICRESP
and
.Fn i2d_OCSP_BASICRESP
decode and encode an ASN.1
.Vt BasicOCSPResponse
structure defined in RFC 6960 section 4.2.1.
.Pp
.Fn d2i_OCSP_RESPDATA
and
.Fn i2d_OCSP_RESPDATA
decode and encode an ASN.1
.Vt ResponseData
structure defined in RFC 6960 section 4.2.1.
.Pp
.Fn d2i_OCSP_RESPID
and
.Fn i2d_OCSP_RESPID
decode and encode an ASN.1
.Vt ResponderID
structure defined in RFC 6960 section 4.2.1.
.Pp
.Fn d2i_OCSP_SINGLERESP
and
.Fn i2d_OCSP_SINGLERESP
decode and encode an ASN.1
.Vt SingleResponse
structure defined in RFC 6960 section 4.2.1.
.Pp
.Fn d2i_OCSP_CERTSTATUS
and
.Fn i2d_OCSP_CERTSTATUS
decode and encode an ASN.1
.Vt CertStatus
structure defined in RFC 6960 section 4.2.1.
.Pp
.Fn d2i_OCSP_REVOKEDINFO
and
.Fn i2d_OCSP_REVOKEDINFO
decode and encode an ASN.1
.Vt RevokedInfo
structure defined in RFC 6960 section 4.2.1.
.Pp
.Fn d2i_OCSP_CRLID
and
.Fn i2d_OCSP_CRLID
decode and encode an ASN.1
.Vt CrlID
structure defined in RFC 6960 section 4.4.2.
.Sh RETURN VALUES
.Fn d2i_OCSP_RESPONSE ,
.Fn d2i_OCSP_RESPBYTES ,
.Fn d2i_OCSP_BASICRESP ,
.Fn d2i_OCSP_RESPDATA ,
.Fn d2i_OCSP_RESPID ,
.Fn d2i_OCSP_SINGLERESP ,
.Fn d2i_OCSP_CERTSTATUS ,
.Fn d2i_OCSP_REVOKEDINFO ,
and
.Fn d2i_OCSP_CRLID
return an object of the respective type or
.Dv NULL
if an error occurs.
.Pp
.Fn i2d_OCSP_RESPONSE ,
.Fn i2d_OCSP_RESPBYTES ,
.Fn i2d_OCSP_BASICRESP ,
.Fn i2d_OCSP_RESPDATA ,
.Fn i2d_OCSP_RESPID ,
.Fn i2d_OCSP_SINGLERESP ,
.Fn i2d_OCSP_CERTSTATUS ,
.Fn i2d_OCSP_REVOKEDINFO ,
and
.Fn i2d_OCSP_CRLID
return the number of bytes successfully encoded or a negative value
if an error occurs.
.Sh SEE ALSO
.Xr ASN1_item_d2i 3 ,
.Xr OCSP_CRLID_new 3 ,
.Xr OCSP_RESPONSE_new 3 ,
.Xr OCSP_SINGLERESP_new 3
.Sh STANDARDS
RFC 6960: X.509 Internet Public Key Infrastructure Online Certificate
Status Protocol, section 4.2: Response Syntax
.Sh HISTORY
These functions first appeared in OpenSSL 0.9.7
and have been available since
.Ox 3.2 .
|