How do I extract information from an SSL key and certificate?

An SSL certificate contains the information about issuer, valid dates, subject and other cryptic information. The openssl x509 subcommand may be used to retrieve those information from a SSL certificate.

# The "-text" option will output full breadth of certificate information.
bash# openssl x509 -text -in server.crt

# The "-issuer" option will show issuer.
bash# openssl x509 -noout -in server.crt -issuer

# The "-subject" option will show Organizational information.
bash# openssl x509 -noout -in server.crt -subject

# The "-dates" option will show valid dates
bash# openssl x509 -noout -in server.crt -dates

# "-hash" and "-fingerprints" may also be used conjunction with other options.
bash# openssl x509 -noout -in server.crt -hash -fingerprint -issuer

Comments

Add new comment

Filtered HTML

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.