I have a .cer certificate file, and need to extract the Public Key. I can only extract to PEM format. The "outform" parameter does nothing.
openssl x509 -inform PEM -in certificate.cer -outform DER -pubkey -noout > publickey.der
Is it possible to extract in DER format?
You cannot export a certificate if you enabled the Do not allow private key to be exportable option while creating the certificate. Click Security > Certificates. On the Certificates page, click the certificate. On the Certificate Details page, click Export Private/Public Keypair.
Chrome 54 and below: If you're using Chrome then click on the green bar to the left of the 'https:' in the address bar, for the VeriSign website the green bar says Symantec Corperation [US] , this will open a pop up. On the pop up click 'Certificate Information'. This will open another pop up.
DER is the most popular encoding format to store data, like X. 509 certificates, and PKCS8 private keys in files. It's a binary encoding, and the resulting content can't be viewed with a text editor. PKCS8 is a standard syntax for storing private key information.
Privacy Enhanced Mail (PEM) files are a type of Public Key Infrastructure (PKI) file used for keys and certificates. PEM, initially invented to make e-mail secure, is now an Internet security standard.
Solved decoding the base64 PEM file:
openssl x509 -in certificate.cer -pubkey -noout | openssl enc -base64 -d > publickey.der
Any other idea is welcome.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With