This is an automated archive.
The original was posted on /r/openssl by /u/maxcoder88 on 2023-03-21 14:15:03+00:00.
Hi,
I have certificate is exported with DER encoding. I want to get CRT , KEY , PEM file from CER file.
Could not read key from certificate.pem
I will convert from CER to PEM via below command.
openssl x509 -inform der -in certificate.cer -out certificate.pem
openssl pkey -in certificate.pem -out certificate.key
openssl crl2pkcs7 -nocrl -certfile certificate.pem | openssl pkcs7 -print_certs -out certificate.crt
openssl pkcs12 -export -out certificate.pfx -inkey certificate.key -in certificate.crt -certfile CACert.crt
or , I will convert Key files from PFX file?
openssl x509 -inform der -in certificate.cer -out certificate.pem
openssl pkcs12 -in certificate.pfx -nocerts -out certificate.key
openssl rsa -in certificate.key -out certificate_private.key
openssl rsa -in certificate.key -pubout -out certificate_public.key
openssl pkcs12 -in certificate.pfx -clcerts -nokeys -out certificate.crt
Thanks,