Ssl view cert

ssl_view_cert

Display a specific field or the full decoded text of an X.509 certificate. The first argument selects the field; the second is the certificate file. For the 'expiry'/'end' field the second argument may be a remote hostname (port defaults to 443 or may be passed as the third argument).

Arguments

  • $1 (string): Field: algorithm | CN | days | email | expiry | end | fingerprint | issuer | modulus | OrgName | SANs | serial | start | state — or any other value for full text
  • $2 (string): Certificate file path (or hostname for remote expiry check)

Exit codes

  • 0: Success
  • 1: No input provided

Output on stdout

  • Requested certificate field value or full decoded certificate text