Print certificate subject and validity dates
Build a paste-ready command, then review its compatibility and effects before running it.
openssl x509 -in <certificate> -noout -subject -issuer -datesComplete required fields to copy the generated command.
read-onlyno known side effects Compatibility
LinuxVerified for Linux using posix, bash, zsh syntax.
Operational knowledgereview due 2027-01-20
Requirementsopensslopenssl must be installed and available on PATH.
Version supportopenssl Current supported releasesVerified for linux using posix, bash, zsh syntax; consult compatibility notes for platform-specific differences.
Expected signalssubject=CN = example.comRepresentative successful output; values vary with the selected target and system state.
Known errorsopenssl: command not foundopenssl is missing or is not available on PATH.
Verifyopenssl x509 -in {{certificate}} -noout -subject -issuer -datesThe output matches the expected target and exits without an error.Rollback noteNot required: this command is read-only and does not change system state.
Command breakdown
01opensslCommandRuns the openssl stage of this one-liner.
02x509ArgumentPasses x509 to openssl.
03-inOptionConfigures openssl with the -in option.
04<certificate>ParameterA value supplied in the Fill parameters section.
05-nooutOptionConfigures openssl with the -noout option.
06-subjectOptionConfigures openssl with the -subject option.
07-issuerOptionConfigures openssl with the -issuer option.
08-datesOptionConfigures openssl with the -dates option.
Example input
openssl x509 -in server.crt -noout -subject -issuer -dates
Example output
subject=CN = example.com
issuer=C = US, O = Example CA, CN = Example RSA
notBefore=Jul 1 00:00:00 2026 GMT
notAfter=Sep 29 23:59:59 2026 GMT
Illustrative output — exact values vary by system and data.
Official sources