How to extract the RSA public key from a .cer and store it in a .pem using OpenSSL?
问题 I have the requirement to extract the public key (RSA) from a *.cer file. I wish to extract the key and store it in a .pem file so I can use its value to encrypt values using jsencrypt. The following command converts a .cer to .pem : openssl x509 -inform der -in certificate.cer -out certificate.pem Yet it doesn't generate a file with the public key but a file with the contents of the *.cer file. -----BEGIN CERTIFICATE----- MIICPDCCAamgAwIBAg............ *lots of extra contents* -----END