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
|
.\" $OpenBSD: d2i_POLICYINFO.3,v 1.1 2016/12/28 20:36:33 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: December 28 2016 $
.Dt D2I_POLICYINFO 3
.Os
.Sh NAME
.Nm d2i_POLICYINFO ,
.Nm i2d_POLICYINFO ,
.Nm d2i_CERTIFICATEPOLICIES ,
.Nm i2d_CERTIFICATEPOLICIES ,
.Nm d2i_POLICYQUALINFO ,
.Nm i2d_POLICYQUALINFO ,
.Nm d2i_USERNOTICE ,
.Nm i2d_USERNOTICE ,
.Nm d2i_NOTICEREF ,
.Nm i2d_NOTICEREF
.Nd decode and encode X.509 certificate policies
.Sh SYNOPSIS
.In openssl/x509v3.h
.Ft POLICYINFO *
.Fo d2i_POLICYINFO
.Fa "POLICYINFO **val_out"
.Fa "const unsigned char **der_in"
.Fa "long length"
.Fc
.Ft int
.Fo i2d_POLICYINFO
.Fa "POLICYINFO *val_in"
.Fa "unsigned char **der_out"
.Fc
.Ft CERTIFICATEPOLICIES *
.Fo d2i_CERTIFICATEPOLICIES
.Fa "CERTIFICATEPOLICIES **val_out"
.Fa "const unsigned char **der_in"
.Fa "long length"
.Fc
.Ft int
.Fo i2d_CERTIFICATEPOLICIES
.Fa "CERTIFICATEPOLICIES *val_in"
.Fa "unsigned char **der_out"
.Fc
.Ft POLICYQUALINFO *
.Fo d2i_POLICYQUALINFO
.Fa "POLICYQUALINFO **val_out"
.Fa "const unsigned char **der_in"
.Fa "long length"
.Fc
.Ft int
.Fo i2d_POLICYQUALINFO
.Fa "POLICYQUALINFO *val_in"
.Fa "unsigned char **der_out"
.Fc
.Ft USERNOTICE *
.Fo d2i_USERNOTICE
.Fa "USERNOTICE **val_out"
.Fa "const unsigned char **der_in"
.Fa "long length"
.Fc
.Ft int
.Fo i2d_USERNOTICE
.Fa "USERNOTICE *val_in"
.Fa "unsigned char **der_out"
.Fc
.Ft NOTICEREF *
.Fo d2i_NOTICEREF
.Fa "NOTICEREF **val_out"
.Fa "const unsigned char **der_in"
.Fa "long length"
.Fc
.Ft int
.Fo i2d_NOTICEREF
.Fa "NOTICEREF *val_in"
.Fa "unsigned char **der_out"
.Fc
.Sh DESCRIPTION
These functions decode and encode X.509 certificate policies.
For details about the semantics, examples, caveats, and bugs, see
.Xr ASN1_item_d2i 3 .
.Pp
.Fn d2i_POLICYINFO
and
.Fn i2d_POLICYINFO
decode and encode an ASN.1
.Vt PolicyInformation
structure defined in RFC 5280 section 4.2.1.4.
.Pp
.Fn d2i_CERTIFICATEPOLICIES
and
.Fn i2d_CERTIFICATEPOLICIES
decode and encode an ASN.1
.Vt CertificatePolicies
structure defined in RFC 5280 section 4.2.1.4.
.Pp
.Fn d2i_POLICYQUALINFO
and
.Fn i2d_POLICYQUALINFO
decode and encode an ASN.1
.Vt PolicyQualifierInfo
structure defined in RFC 5280 section 4.2.1.4.
.Pp
.Fn d2i_USERNOTICE
and
.Fn i2d_USERNOTICE
decode and encode an ASN.1
.Vt UserNotice
structure defined in RFC 5280 section 4.2.1.4.
.Pp
.Fn d2i_NOTICEREF
and
.Fn i2d_NOTICEREF
decode and encode an ASN.1
.Vt NoticeReference
structure defined in RFC 5280 section 4.2.1.4.
.Sh RETURN VALUES
.Fn d2i_POLICYINFO ,
.Fn d2i_CERTIFICATEPOLICIES ,
.Fn d2i_POLICYQUALINFO ,
.Fn d2i_USERNOTICE ,
and
.Fn d2i_NOTICEREF
return a
.Vt POLICYINFO ,
.Vt CERTIFICATEPOLICIES ,
.Vt POLICYQUALINFO ,
.Vt USERNOTICE ,
or
.Vt NOTICEREF
object, respectively, or
.Dv NULL
if an error occurs.
.Pp
.Fn i2d_POLICYINFO ,
.Fn i2d_CERTIFICATEPOLICIES ,
.Fn i2d_POLICYQUALINFO ,
.Fn i2d_USERNOTICE ,
and
.Fn i2d_NOTICEREF
return the number of bytes successfully encoded or a negative value
if an error occurs.
.Sh SEE ALSO
.Xr ASN1_item_d2i 3 ,
.Xr POLICYINFO_new 3 ,
.Xr X509_EXTENSION_new 3
.Sh STANDARDS
RFC 5280: Internet X.509 Public Key Infrastructure Certificate and
Certificate Revocation List (CRL) Profile,
section 4.2.1.4: Certificate Policies
|