I'm trying to export a private key from a pfx-file using OpenSSL:
openssl pkcs12 -in C:\tmp\pfxfile.pfx -nocerts -nodes -out C:\tmp\prvkey.pem
I get the prompt to enter the password:
Enter Import Password:
upon entering a files gets created but I get the following error message:
Warning unsupported bag type: secretBag
I tried some research, but I couldn't find out if the warning poses a problem. The final goal is to create a pvk file for the private key which fails with a error message - please see my other question.
Here's the content of prvkey.pem
:
Bag Attributes
localKeyID: 01 00 00 00
friendlyName: **-********-****-****-****-************
Microsoft CSP Name: Microsoft Enhanced Cryptographic Provider v1.0
Key Attributes
X509v3 Key Usage: 80
-----BEGIN PRIVATE KEY-----
****************************************************************
****************************************************************
****************************************************************
****************************************************************
****************************************************************
****************************************************************
****************************************************************
****************************************************************
****************************************************************
****************************************************************
****************************************************************
****************************************************************
****************************************************************
****************************************************************
****************************************************************
****************************************************************
****************************************************************
****************************************************************
****************************************************************
****************************************************************
****************************************************************
****************************************************************
****************************************************************
****************************************************************
****************************************************************
************************
-----END PRIVATE KEY-----
----BEGIN PRIVATE KEY-----
and end with-----END PRIVATE KEY-----
? Can you view it withopenssl rsa -in prvkey.pem -noout -text
and/or verify it withopenssl rsa -in prvkey.pem -noout -check
?