Skip to content

Instantly share code, notes, and snippets.

@csamsel
Last active April 18, 2024 07:25
Show Gist options
  • Save csamsel/edb58d84363aa6c18be0f45be7908d34 to your computer and use it in GitHub Desktop.
Save csamsel/edb58d84363aa6c18be0f45be7908d34 to your computer and use it in GitHub Desktop.
convert ssl certificates from pem to crt/key
openssl rsa -outform der -in privkey.pem -out privkey.key
openssl x509 -outform der -in fullchain.pem -out fullchain.crt
openssl x509 -outform der -in cert.pem -out cert.crt
@MunyaradziMudukuti
Copy link

Thanks this is really helpful.

@m3l3d
Copy link

m3l3d commented May 20, 2022

openssl crl2pkcs7 -nocrl -certfile your-cert.pem | openssl pkcs7 -print_certs -out your-cert.crt

@vyom-soft
Copy link

with this command openssl x509 -outform der -in cert.pem -out cert.crt
The generated size of .crt is less compare to .pem file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment