openssl x509 -in cert.pem -noout -subject -issuer -dates -serialopenssl x509 -in cert.pem -noout -fingerprint -sha256openssl x509 -in cert.pem -noout -text # full dump: extensions, SPKI, sigopenssl x509 -in cert.pem -pubkey -noout > pub.pem # SPKI public keyopenssl x509 -inform DER -in cert.der -noout -subject # binary certificatesopenssl s_client -connect ecdsa.com:443 -servername ecdsa.com </dev/null 2>/dev/null \ | openssl x509 -noout -subject -dates -fingerprint -sha256How it works
-nooutsuppresses re-printing the PEM itself — combine it with field flags for script-friendly output.-textshows everything, including extensions (SAN, key usage) and the SubjectPublicKeyInfo with the curve name.-pubkeyextracts the exact SPKI PEM other recipes on this site consume for signature verification and fingerprinting.openssl x509reads only the first certificate in a bundle file — to dump a full chain, useopenssl storeutl -noout -text chain.pem, which iterates over every block.
Gotchas
- PEM is the default
-inform; a binary DER certificate fails withunable to load certificateuntil you add-inform DER— the error message never hints at that. -fingerprintwithout-sha256still uses SHA-1 in many builds — always specify the hash explicitly when comparing fingerprints across tools.- In the
-textoutput,Signature Algorithmappears twice and describes the CA's signature over this certificate — the certificate's own key type is underSubject Public Key Info.