PEM file content.I have the passphrase of PEM file as well.
*Bag Attributes
localKeyID: 12 7B 3C 4C ...
subject=/C..OTHER FIELDS
-----BEGIN CERTIFICATE-----
...
-----END CERTIFICATE-----
Bag Attributes
localKeyID: 12 7B 3C 4C ..
Key Attributes: <No Attributes>
-----BEGIN ENCRYPTED PRIVATE KEY-----
...
-----END ENCRYPTED PRIVATE KEY-----*
I am able to extract certificate from PEM file with command.
openssl x509 -outform der -in client.pem -out your-cert.crt
But I am not able to extract private key.Tried below listed commands. OpenSSL hangs for both the commands. Am I missing something obvious here ?
openssl pkey -in client.pem -out key.pem
I need to extract client cert and key file to create SSLSocketFactory
object in java.
openss pkcs12 ...
command. Dave Thompson provides anawk
command at What are bag attributes and how can i generate them? – jwwopenssl
to convert a certificate, you should ask on another site in the stack exchange network. – jww