1 .\" $OpenBSD: d2i_PKCS12.3,v 1.1 2016/12/26 18:04:45 schwarze Exp $
3 .\" Copyright (c) 2016 Ingo Schwarze <schwarze@openbsd.org>
5 .\" Permission to use, copy, modify, and distribute this software for any
6 .\" purpose with or without fee is hereby granted, provided that the above
7 .\" copyright notice and this permission notice appear in all copies.
9 .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10 .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12 .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15 .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 .Dd $Mdocdate: December 26 2016 $
27 .Nm d2i_PKCS12_MAC_DATA ,
28 .Nm i2d_PKCS12_MAC_DATA ,
29 .Nm d2i_PKCS12_SAFEBAG ,
30 .Nm i2d_PKCS12_SAFEBAG ,
33 .Nd decode and encode PKCS#12 structures
38 .Fa "PKCS12 **val_out"
39 .Fa "const unsigned char **der_in"
45 .Fa "unsigned char **der_out"
50 .Fa "PKCS12 **val_out"
60 .Fa "PKCS12 **val_out"
68 .Fo d2i_PKCS12_MAC_DATA
69 .Fa "PKCS12_MAC_DATA **val_out"
70 .Fa "const unsigned char **der_in"
74 .Fo i2d_PKCS12_MAC_DATA
75 .Fa "PKCS12_MAC_DATA *val_in"
76 .Fa "unsigned char **der_out"
79 .Fo d2i_PKCS12_SAFEBAG
80 .Fa "PKCS12_SAFEBAG **val_out"
81 .Fa "const unsigned char **der_in"
85 .Fo i2d_PKCS12_SAFEBAG
86 .Fa "PKCS12_SAFEBAG *val_in"
87 .Fa "unsigned char **der_out"
91 .Fa "PKCS12_BAGS **val_out"
92 .Fa "const unsigned char **der_in"
97 .Fa "PKCS12_BAGS *val_in"
98 .Fa "unsigned char **der_out"
101 These functions decode and encode PKCS#12 structures.
102 For details about the semantics, examples, caveats, and bugs, see
103 .Xr ASN1_item_d2i 3 .
108 decode and encode an ASN.1
110 .Pq personal information exchange
111 structure defined in RFC 7292 section 4.
117 are similar except that they decode or encode using a
123 .Fn d2i_PKCS12_MAC_DATA
125 .Fn i2d_PKCS12_MAC_DATA
126 decode and encode an ASN.1
128 structure defined in RFC 7292 section 4.
130 .Fn d2i_PKCS12_SAFEBAG
132 .Fn i2d_PKCS12_SAFEBAG
133 decode and encode an ASN.1
135 structure defined in RFC 7292 section 4.2.
140 decode and encode the bagValue field of an ASN.1
154 .Fn d2i_PKCS12_MAC_DATA ,
155 .Fn d2i_PKCS12_SAFEBAG ,
159 .Vt PKCS12_MAC_DATA ,
163 object, respectively, or
168 .Fn i2d_PKCS12_MAC_DATA ,
169 .Fn i2d_PKCS12_SAFEBAG ,
172 return the number of bytes successfully encoded or a negative value
178 return 1 for success or 0 if an error occurs.
180 .Xr ASN1_item_d2i 3 ,
181 .Xr PKCS12_create 3 ,
184 .Xr PKCS12_SAFEBAG_new 3
186 RFC 7292: PKCS #12: Personal Information Exchange Syntax