I want to extract x509 cert and private key from pkcs12 file using a C lib. I found lot of .net utils to do this, but did not find any C libraries. My code will run in WinPE environment, so .net will not work.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can use OpenSSL to do this. The function
d2i_PKCS12_fp()can be used to load a PKCS#12 file into aPKCS12object, and the functionPKCS12_parse()can be used to parse the resulting object to extract the certificate and private key:See the
PKCS12_parse()man page for more details.