OpenSSL x509 Certificate Utilities

From UNIX Systems Administration
Jump to navigation Jump to search

x509 PEM-formatted Information

  • Extension(s) .pem, .crt, .cer
  • PEM encoded certificate is a file format for storing X.509 certificates. It is one of many PEM formats.
  • A PEM encoded certificate file is plain text. It contains one or more pairs of "-----BEGIN CERTIFICATE-----" and "-----END CERTIFICATE-----" lines, with base64-encoded data between them.

x509 PEM-formatted Commands

  1. View the contents of an x509 PEM-formatted certificate.
    1. # openssl x509 -noout -text -in <certificate-pem>.crt
  2. Convert from an x509 PEM-formatted certificate format to an x509 DER-formatted certificate.
    1. # openssl x509 -in <certificate-x509-pem>.crt -outform der -out <certificate-x509-der>.crt

x509 DER-formatted Information

  • Extension(s) .der, .crt, .cer
  • DER encoded certificate is a file format for storing an X.509 certificate.

x509 DER-formatted Commands

  1. View the contents of an x509 DER-formatted certificate.
    1. # openssl x509 -noout -text -inform der -in <certificate-der>.crt
  2. Convert from an x509 DER-formatted certificate format to an x509 PEM-formatted certificate.
    1. # openssl x509 -in <certificate-der>.crt -inform der -outform pem -out <certificate-pem>.crt

Further Reading

  1. x509 PEM encoded Certificate
  2. OpenSSL x509