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
19 corresponding certificate to *cert and any additional certificates to
20 *ca.
21
23 The parameters pkey and cert cannot be NULL. ca can be <NULL> in which
24 case additional certificates will be discarded. *ca can also be a valid
25 STACK in which case additional certificates are appended to *ca. If *ca
26 is NULL a new STACK will be allocated.
27
28 The friendlyName and localKeyID attributes (if present) on each
29 certificate will be stored in the alias and keyid attributes of the
30 X509 structure.
31
33 PKCS12_parse() returns 1 for success and zero if an error occurred.
34
35 The error can be obtained from ERR_get_error(3)
36
38 Only a single private key and corresponding certificate is returned by
39 this function. More complex PKCS#12 files with multiple private keys
40 will only return the first match.
41
42 Only friendlyName and localKeyID attributes are currently stored in
43 certificates. Other attributes are discarded.
44
45 Attributes currently cannot be stored in the private key EVP_PKEY
46 structure.
47
49 d2i_PKCS12(3)
50
52 PKCS12_parse was added in OpenSSL 0.9.3
53
54
55
561.0.0e 2009-05-17 PKCS12_parse(3)