PKCS12_parse(3) OpenSSL PKCS12_parse(3) NNAAMMEE PKCS12_parse - parse a PKCS#12 structure SSYYNNOOPPSSIISS #include int PKCS12_parse(PKCS12 *p12, const char *pass, EVP_PKEY **pkey, X509 **cert, STACK_OF(X509) **ca); DDEESSCCRRIIPPTTIIOONN _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 correspond- ing certificate to **cceerrtt and any additional certificates to **ccaa. NNOOTTEESS 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 cer- tificate will be stored in the aalliiaass and kkeeyyiidd attributes of the XX550099 structure. RREETTUURRNN VVAALLUUEESS _P_K_C_S_1_2___p_a_r_s_e_(_) returns 1 for success and zero if an error occurred. The error can be obtained from _E_R_R___g_e_t___e_r_r_o_r(3) BBUUGGSS 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 stored in the private key EEVVPP__PPKKEEYY structure. SSEEEE AALLSSOO _d_2_i___P_K_C_S_1_2(3) HHIISSTTOORRYY PKCS12_parse was added in OpenSSL 0.9.3 1.0.1u 2016-09-22 PKCS12_parse(3)