Ssl validate cert

ssl_validate_cert

Validate that a certificate, private key, and CSR all share the same modulus. If key and/or CSR paths are omitted, they are inferred from the certificate basename. e.g. for 'example.com.crt', 'example.com.key' and 'example.com.csr' are assumed.

Arguments

  • $1 (string): Certificate file (.crt or .pem)
  • $2 (string): Private key file (optional; default: cert basename + .key)
  • $3 (string): CSR file (optional; default: cert basename + .csr)

Exit codes

  • 0: Certificate, key, and CSR moduli all match
  • 1: No certificate provided, missing/unreadable files, or modulus mismatch