c - Extract x509 cert and private key from pkcs12 file -


I want to extract x509 cert and private key from pkcs12 file using a cob. I got lots of pure uses to do this, but no c library was found. My code will run in the WinPE environment, so .net will not work.

You can use OpenSSL this. Function d2i_PKCS12_fp () can be used to load the PKCS # 12 file in a PKCS12 object, and the function PKCS12_parse () Can be used to extract the certificate and private key to parse the resulting object:

  PKCS12 * d2i_PKCS12_fp (FILE * fp, PKCS12 ** p12); Int PKCS 12 Aparsus (PKCS 12 * P12, Const four * pass, EVP_PKEY ** Paki, X509 ** cert, STACK_OF (X50 9) ** CA);  

See for more information.


Comments