1PKCS12_parse(3) OpenSSL PKCS12_parse(3)
2
3
4
6 PKCS12_parse - parse a PKCS#12 structure
7
9 #include <openssl/pkcs12.h>
10
11 int PKCS12_parse(PKCS12 *p12, const char *pass, EVP_PKEY **pkey, X509
12 **cert, STACK_OF(X509) **ca);
13
15 PKCS12_parse() parses a PKCS12 structure.
16
17 p12 is the PKCS12 structure to parse. pass is the passphrase to use.
18 If successful the private key will be written to *pkey, the correspond‐
19 ing certificate to *cert and any additional certificates to *ca.
20
22 The parameters pkey and cert cannot be NULL. ca can be <NULL> in which
23 case additional certificates will be discarded. *ca can also be a valid
24 STACK in which case additional certificates are appended to *ca. If *ca
25 is NULL a new STACK will be allocated.
26
27 The friendlyName and localKeyID attributes (if present) on each cer‐
28 tificate will be stored in the alias and keyid attributes of the X509
29 structure.
30
32 Only a single private key and corresponding certificate is returned by
33 this function. More complex PKCS#12 files with multiple private keys
34 will only return the first match.
35
36 Only friendlyName and localKeyID attributes are currently stored in
37 certificates. Other attributes are discarded.
38
39 Attributes currently cannot be store in the private key EVP_PKEY struc‐
40 ture.
41
43 d2i_PKCS12(3)
44
46 PKCS12_parse was added in OpenSSL 0.9.3
47
48
49
500.9.8b 2002-10-09 PKCS12_parse(3)