certz inspect -- Reference

May 2, 2026 ยท View on GitHub

Deep-read a certificate from any source and display its properties, extensions, chain, and optionally check revocation status.

See also: Certificate Formats | Certificate Chain | Windows Trust Store | Exit Codes


Source Types

inspect accepts three kinds of source identifiers. It detects the type automatically:

PriorityConditionAction
1Source starts with https://Remote TLS inspection
2--store flag is providedThumbprint lookup in that store
3A file exists at the pathFile inspection
4Source is a 40-char hex stringThumbprint lookup in default store
5None of the aboveError: file not found

File

# PFX (password required)
certz inspect server.pfx --password MyPassword

# PEM certificate (no password)
certz inspect server.pem
certz inspect server.crt
certz inspect server.cer

# DER-encoded binary certificate
certz inspect server.der

# JSON output for scripting
certz inspect server.pfx --password MyPassword --format json

Remote HTTPS URL

No password needed -- certz connects and reads the certificate from the TLS handshake:

# Standard HTTPS
certz inspect https://example.com

# Non-standard port
certz inspect https://api.internal:8443
certz inspect https://localhost:8443

# With expiry warning
certz inspect https://example.com --warn 30

Windows Certificate Store

Provide a thumbprint (full 40-char or partial 8+ char prefix) plus --store:

# Inspect from My store (CurrentUser -- default when no --store)
certz inspect ABC123DEF456789012345678901234567890ABCD

# Specify store and location explicitly
certz inspect ABC123DEF456 --store Root
certz inspect ABC123DEF456 --store Root --location LocalMachine
certz inspect ABC123DEF456 --store CA --location CurrentUser

Chain Inspection

--chain -- include chain information

Fetches and validates the full certificate chain from end-entity up to the Root CA.

certz inspect https://example.com --chain
certz inspect server.pfx --password Pass --chain

--tree -- detailed chain tree

--tree implies --chain. Displays each chain element with key info, SANs, validity dates, signature algorithm, and any validation errors.

certz inspect https://example.com --tree

Sample tree output:

Certificate Chain
=================

Root CA (depth 2)
  Subject:    CN=GlobalSign Root CA R3
  Thumbprint: D69B561148F01C77C54578C10926DF5B856976AD
  Key:        RSA 2048
  Validity:   2009-03-18 to 2029-03-18 (1,089 days remaining)
  Self-signed: Yes

Intermediate CA (depth 1)
  Subject:    CN=GlobalSign RSA OV SSL CA 2018
  Issuer:     CN=GlobalSign Root CA R3
  Thumbprint: 8F103249518BC1273CA0F6B19C655EA5F4CAFA2
  Key:        RSA 2048
  Validity:   2018-11-21 to 2028-11-21 (973 days remaining)

End-entity (depth 0)
  Subject:    CN=example.com
  Issuer:     CN=GlobalSign RSA OV SSL CA 2018
  Thumbprint: 1A2B3C4D5E6F...
  Key:        ECDSA P-256
  SANs:       example.com, www.example.com
  Validity:   2025-01-01 to 2026-01-01 (127 days remaining)

--crl -- revocation check

Checks each certificate in the chain for revocation. OCSP is attempted first; CRL is the fallback. The result is shown in --tree output as Revocation: Good / Revoked / Unknown.

# Chain + revocation check
certz inspect https://example.com --chain --crl

# Detailed tree with revocation
certz inspect https://example.com --tree --crl

Note: Revocation checking requires network access to OCSP/CRL endpoints. Certificates that omit these extensions will show Revocation: Unknown.


Save Output Options

Save the certificate (and optionally its private key) to files for use in other tools.

# Save certificate as PEM (default)
certz inspect https://example.com --save github.cer

# Save certificate and private key from PFX
certz inspect server.pfx --password Pass --save cert.pem --save-key key.pem

# Save certificate in DER format
certz inspect server.pfx --password Pass --save cert.der --save-format der
OptionDefaultDescription
--save <file>(none)Save the certificate to a file
--save-key <file>(none)Save the private key to a file (only available when source has a private key)
--save-formatpemOutput format for saved files: pem or der

Full Options

OptionDefaultDescription
<source>(required, except with --guided)File path, https:// URL, or certificate thumbprint
--guided, -gfalseLaunch the interactive wizard. Prompts for source, password, and chain options.
--password, -p(none)Password for PFX files. Also reads from CERTZ_PASSWORD env var.
--chain, -cfalseInclude the full certificate chain in output
--tree, -tfalseDetailed chain tree with key info, SANs, signatures (implies --chain)
--crlfalseCheck revocation status (OCSP preferred, CRL fallback)
--warn, -w <days>(none)Warn and exit 1 if certificate expires within N days
--save <file>(none)Save certificate to file
--save-key <file>(none)Save private key to file
--save-formatpemSave format: pem or der
--store, -s(none)Certificate store for thumbprint lookup: My, Root, CA
--location, -lCurrentUserStore location: CurrentUser or LocalMachine
--formattextOutput format: text or json

JSON Output Schema

certz inspect server.pfx --password Pass --format json

Example output:

{
  "subject": "CN=api.company.com, O=Company, C=US",
  "issuer": "CN=api.company.com, O=Company, C=US",
  "thumbprint": "A1B2C3D4E5F6789012345678901234567890ABCD",
  "serialNumber": "1234567890ABCDEF",
  "notBefore": "2025-10-26T00:00:00",
  "notAfter": "2026-01-23T00:00:00",
  "daysRemaining": 64,
  "keyAlgorithm": "ECDSA",
  "keySize": 256,
  "signatureAlgorithm": "sha256ECDSA",
  "subjectAlternativeNames": ["api.company.com", "localhost", "127.0.0.1"],
  "keyUsages": ["DigitalSignature"],
  "enhancedKeyUsages": ["Server Authentication", "Client Authentication"],
  "isCa": false,
  "pathLengthConstraint": null,
  "hasPrivateKey": true,
  "source": "File",
  "sourcePath": "server.pfx",
  "chainIsValid": false,
  "chain": null,
  "warnings": []
}

When --chain is provided, chain is an array of chain elements:

{
  "chain": [
    {
      "subject": "CN=api.company.com",
      "issuer": "CN=Dev CA",
      "thumbprint": "A1B2C3D4...",
      "serialNumber": "01",
      "notBefore": "2025-10-26T00:00:00",
      "notAfter": "2026-01-23T00:00:00",
      "isCa": false,
      "isSelfSigned": false,
      "keyAlgorithm": "ECDSA",
      "keySize": 256,
      "signatureAlgorithm": "sha256ECDSA",
      "subjectAlternativeNames": ["api.company.com", "localhost"],
      "daysRemaining": 64,
      "revocationStatus": null,
      "crlDistributionPoints": [],
      "ocspResponder": null,
      "validationErrors": []
    }
  ]
}

Top-level fields:

FieldTypeDescription
subjectstringSubject Distinguished Name
issuerstringIssuer Distinguished Name
thumbprintstringSHA-1 thumbprint (hex, uppercase, no colons)
serialNumberstringCertificate serial number (hex)
notBeforeISO 8601Validity start (UTC)
notAfterISO 8601Expiry date (UTC)
daysRemainingintDays until expiry; negative if expired
keyAlgorithmstringKey algorithm: RSA, ECDSA, etc.
keySizeintKey size in bits (256 for ECDSA P-256, 2048/3072/4096 for RSA)
signatureAlgorithmstringSignature hash and algorithm (e.g., sha256ECDSA)
subjectAlternativeNamesstring[]DNS names, IP addresses, and URIs in the SAN extension
keyUsagesstring[]Key Usage extension values (e.g., DigitalSignature)
enhancedKeyUsagesstring[]EKU OID friendly names (e.g., Server Authentication)
isCabooltrue if Basic Constraints has CA:TRUE
pathLengthConstraintint or nullPath length constraint for CA certs; null if not set
hasPrivateKeybooltrue if source included a private key (PFX)
sourcestring"File", "Url", or "Store"
sourcePathstring or nullFile path, URL, or store reference
chainIsValidbooltrue when chain is present and valid
chainarray or nullChain elements (only when --chain was used)
warningsstring[]Any warnings raised during inspection

Each chain[] element:

FieldTypeDescription
subjectstringSubject DN
issuerstringIssuer DN
thumbprintstringSHA-1 thumbprint
serialNumberstringSerial number (hex)
notBeforeISO 8601Validity start
notAfterISO 8601Expiry date
isCaboolWhether this element is a CA cert
isSelfSignedbooltrue when Subject equals Issuer
keyAlgorithmstring or nullKey algorithm
keySizeintKey size in bits
signatureAlgorithmstring or nullSignature algorithm
subjectAlternativeNamesstring[]SANs (typically non-empty only for end-entity)
daysRemainingintDays until expiry
revocationStatusstring or null"Good", "Revoked", "Unknown", or null (not checked)
crlDistributionPointsstring[]CRL Distribution Point URLs
ocspResponderstring or nullOCSP responder URL
validationErrorsstring[]Chain validation errors for this element

Troubleshooting

ProblemLikely causeFix
"File not found" on a PFXWrong path or typoVerify the file path and check with dir or ls.
"Cannot open PFX" or invalid passwordWrong password for the PFX fileProvide the correct password with --password.
Chain incomplete for a URLServer not sending intermediate certificatesNote: this is a server-side configuration issue. Run certz inspect --chain against the URL; missing intermediates will show as chain errors.
Thumbprint lookup returns no resultsWrong store or locationRun certz store list --store My (and Root, CA) to find where the cert is installed. Add --location LocalMachine if installed machine-wide.
chainIsValid: false despite cert looking correctRoot CA not trusted on this machineThe root must be in the Root trust store. Add it with certz trust add ca.cer --store Root.
Revocation shows UnknownCertificate has no OCSP/CRL endpoints, or network blockedExpected for self-signed or internal CA certs. For public certs, check firewall or proxy rules.
Exit code 1 after a successful inspect--warn threshold triggereddaysRemaining is below the --warn value. Renew the certificate or remove --warn.