PKCS12_parse 3 2003-07-24 0.9.9-dev OpenSSL

NAME

PKCS12_parse - parse a PKCS#12 structure

LIBRARY

libcrypto, -lcrypto

SYNOPSIS


 #include 

int PKCS12_parse(PKCS12 *p12, const char *pass, EVP_PKEY **pkey, X509 **cert, STACK_OF(X509) **ca);

DESCRIPTION

_P_K_C_S_1_2___p_a_r_s_e_(_) parses a PKCS12 structure.

pp1122 is the PPKKCCSS1122 structure to parse. ppaassss is the passphrase to use. If successful the private key will be written to **ppkkeeyy, the corresponding certificate to **cceerrtt and any additional certificates to **ccaa.

NOTES

The parameters ppkkeeyy and cceerrtt cannot be NNUULLLL. ccaa can be in which case additional certificates will be discarded. **ccaa can also be a valid STACK in which case additional certificates are appended to **ccaa. If **ccaa is NNUULLLL a new STACK will be allocated.

The ffrriieennddllyyNNaammee and llooccaallKKeeyyIIDD attributes (if present) on each certificate will be stored in the aalliiaass and kkeeyyiidd attributes of the XX550099 structure.

BUGS

Only a single private key and corresponding certificate is returned by this function. More complex PKCS#12 files with multiple private keys will only return the first match.

Only ffrriieennddllyyNNaammee and llooccaallKKeeyyIIDD attributes are currently stored in certificates. Other attributes are discarded.

Attributes currently cannot be store in the private key EEVVPP__PPKKEEYY structure.

SEE ALSO

_d_2_i___P_K_C_S_1_2(3)

HISTORY

PKCS12_parse was added in OpenSSL 0.9.3