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
|
.\" $OpenBSD: d2i_OCSP_REQUEST.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_REQUEST 3
.Os
.Sh NAME
.Nm d2i_OCSP_REQUEST ,
.Nm i2d_OCSP_REQUEST ,
.Nm d2i_OCSP_SIGNATURE ,
.Nm i2d_OCSP_SIGNATURE ,
.Nm d2i_OCSP_REQINFO ,
.Nm i2d_OCSP_REQINFO ,
.Nm d2i_OCSP_ONEREQ ,
.Nm i2d_OCSP_ONEREQ ,
.Nm d2i_OCSP_CERTID ,
.Nm i2d_OCSP_CERTID ,
.Nm d2i_OCSP_SERVICELOC ,
.Nm i2d_OCSP_SERVICELOC
.Nd decode and encode OCSP requests
.Sh SYNOPSIS
.In openssl/ocsp.h
.Ft OCSP_REQUEST *
.Fo d2i_OCSP_REQUEST
.Fa "OCSP_REQUEST **val_out"
.Fa "const unsigned char **der_in"
.Fa "long length"
.Fc
.Ft int
.Fo i2d_OCSP_REQUEST
.Fa "OCSP_REQUEST *val_in"
.Fa "unsigned char **der_out"
.Fc
.Ft OCSP_SIGNATURE *
.Fo d2i_OCSP_SIGNATURE
.Fa "OCSP_SIGNATURE **val_out"
.Fa "const unsigned char **der_in"
.Fa "long length"
.Fc
.Ft int
.Fo i2d_OCSP_SIGNATURE
.Fa "OCSP_SIGNATURE *val_in"
.Fa "unsigned char **der_out"
.Fc
.Ft OCSP_REQINFO *
.Fo d2i_OCSP_REQINFO
.Fa "OCSP_REQINFO **val_out"
.Fa "const unsigned char **der_in"
.Fa "long length"
.Fc
.Ft int
.Fo i2d_OCSP_REQINFO
.Fa "OCSP_REQINFO *val_in"
.Fa "unsigned char **der_out"
.Fc
.Ft OCSP_ONEREQ *
.Fo d2i_OCSP_ONEREQ
.Fa "OCSP_ONEREQ **val_out"
.Fa "const unsigned char **der_in"
.Fa "long length"
.Fc
.Ft int
.Fo i2d_OCSP_ONEREQ
.Fa "OCSP_ONEREQ *val_in"
.Fa "unsigned char **der_out"
.Fc
.Ft OCSP_CERTID *
.Fo d2i_OCSP_CERTID
.Fa "OCSP_CERTID **val_out"
.Fa "const unsigned char **der_in"
.Fa "long length"
.Fc
.Ft int
.Fo i2d_OCSP_CERTID
.Fa "OCSP_CERTID *val_in"
.Fa "unsigned char **der_out"
.Fc
.Ft OCSP_SERVICELOC *
.Fo d2i_OCSP_SERVICELOC
.Fa "OCSP_SERVICELOC **val_out"
.Fa "const unsigned char **der_in"
.Fa "long length"
.Fc
.Ft int
.Fo i2d_OCSP_SERVICELOC
.Fa "OCSP_SERVICELOC *val_in"
.Fa "unsigned char **der_out"
.Fc
.Sh DESCRIPTION
Theses functions decode and encode ASN.1 structures used for OCSP
requests.
For details about the semantics, examples, caveats, and bugs, see
.Xr ASN1_item_d2i 3 .
.Pp
.Fn d2i_OCSP_REQUEST
and
.Fn i2d_OCSP_REQUEST
decode and encode an ASN.1
.Vt OCSPRequest
structure defined in RFC 6960 section 4.1.1.
.Pp
.Fn d2i_OCSP_SIGNATURE
and
.Fn i2d_OCSP_SIGNATURE
decode and encode an ASN.1
.Vt Signature
structure defined in RFC 6960 section 4.1.1.
.Pp
.Fn d2i_OCSP_REQINFO
and
.Fn i2d_OCSP_REQINFO
decode and encode an ASN.1
.Vt TBSRequest
structure defined in RFC 6960 section 4.1.1.
.Pp
.Fn d2i_OCSP_ONEREQ
and
.Fn i2d_OCSP_ONEREQ
decode and encode an ASN.1
.Vt Request
structure defined in RFC 6960 section 4.1.1.
.Pp
.Fn d2i_OCSP_CERTID
and
.Fn i2d_OCSP_CERTID
decode and encode an ASN.1
.Vt CertID
structure defined in RFC 6960 section 4.1.1.
.Pp
.Fn d2i_OCSP_SERVICELOC
and
.Fn i2d_OCSP_SERVICELOC
decode and encode an ASN.1
.Vt ServiceLocator
structure defined in RFC 6960 section 4.4.6.
.Sh RETURN VALUES
.Fn d2i_OCSP_REQUEST ,
.Fn d2i_OCSP_SIGNATURE ,
.Fn d2i_OCSP_REQINFO ,
.Fn d2i_OCSP_ONEREQ ,
.Fn d2i_OCSP_CERTID ,
and
.Fn d2i_OCSP_SERVICELOC
return an object of the respective type or
.Dv NULL
if an error occurs.
.Pp
.Fn i2d_OCSP_REQUEST ,
.Fn i2d_OCSP_SIGNATURE ,
.Fn i2d_OCSP_REQINFO ,
.Fn i2d_OCSP_ONEREQ ,
.Fn i2d_OCSP_CERTID ,
and
.Fn i2d_OCSP_SERVICELOC
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_CERTID_new 3 ,
.Xr OCSP_REQUEST_new 3 ,
.Xr OCSP_SERVICELOC_new 3
.Sh STANDARDS
RFC 6960: X.509 Internet Public Key Infrastructure Online Certificate
Status Protocol, section 4.1: Request Syntax
.Sh HISTORY
These functions first appeared in OpenSSL 0.9.7
and have been available since
.Ox 3.2 .
|