summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/man/PKCS12_parse.3
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/man/PKCS12_parse.3')
-rw-r--r--src/lib/libcrypto/man/PKCS12_parse.390
1 files changed, 90 insertions, 0 deletions
diff --git a/src/lib/libcrypto/man/PKCS12_parse.3 b/src/lib/libcrypto/man/PKCS12_parse.3
new file mode 100644
index 0000000000..6930bdf339
--- /dev/null
+++ b/src/lib/libcrypto/man/PKCS12_parse.3
@@ -0,0 +1,90 @@
1.Dd $Mdocdate: November 3 2016 $
2.Dt PKCS12_PARSE 3
3.Os
4.Sh NAME
5.Nm PKCS12_parse
6.Nd parse a PKCS#12 structure
7.Sh SYNOPSIS
8.In openssl/pkcs12.h
9.Ft int
10.Fo PKCS12_parse
11.Fa "PKCS12 *p12"
12.Fa "const char *pass"
13.Fa "EVP_PKEY **pkey"
14.Fa "X509 **cert"
15.Fa "STACK_OF(X509) **ca"
16.Fc
17.Sh DESCRIPTION
18.Fn PKCS12_parse
19parses a PKCS12 structure.
20.Pp
21.Fa p12
22is the
23.Vt PKCS12
24structure to parse.
25.Fa pass
26is the passphrase to use.
27If successful, the private key will be written to
28.Pf * Fa pkey ,
29the corresponding certificate to
30.Pf * Fa cert ,
31and any additional certificates to
32.Pf * Fa ca .
33.Pp
34The parameters
35.Fa pkey
36and
37.Fa cert
38cannot be
39.Dv NULL .
40.Fa ca
41can be
42.Dv NULL ,
43in which case additional certificates will be discarded.
44.Pf * Fa ca
45can also be a valid STACK in which case additional certificates are
46appended to
47.Pf * Fa ca .
48If
49.Pf * Fa ca
50is
51.Dv NULL ,
52a new STACK will be allocated.
53.Pp
54The
55.Sy friendlyName
56and
57.Sy localKeyID
58attributes (if present) of each certificate will be stored in the
59.Fa alias
60and
61.Fa keyid
62attributes of the
63.Vt X509
64structure.
65.Sh RETURN VALUES
66.Fn PKCS12_parse
67returns 1 for success and 0 if an error occurred.
68.Pp
69The error can be obtained from
70.Xr ERR_get_error 3 .
71.Sh SEE ALSO
72.Xr d2i_PKCS12 3
73.Sh HISTORY
74PKCS12_parse was added in OpenSSL 0.9.3.
75.Sh BUGS
76Only a single private key and corresponding certificate is returned by
77this function.
78More complex PKCS#12 files with multiple private keys will only return
79the first match.
80.Pp
81Only
82.Sy friendlyName
83and
84.Sy localKeyID
85attributes are currently stored in certificates.
86Other attributes are discarded.
87.Pp
88Attributes currently cannot be stored in the private key
89.Vt EVP_PKEY
90structure.