certz lint -- Reference

May 2, 2026 ยท View on GitHub

Validate certificates against industry compliance standards before deployment. certz lint runs the same checks that browsers and CAs apply, so violations surface in your terminal rather than as trust errors in production.

See also: Compliance Standards | Subject Alternative Names | RSA vs ECDSA | Exit Codes


Quick Examples

# Lint a PFX (CA/B Forum rules by default)
certz lint cert.pfx --password MyPassword

# Lint a PEM file
certz lint cert.pem --policy cabf

# Lint a remote certificate
certz lint https://example.com

# Lint with Mozilla NSS policy (stricter -- includes CA/B Forum)
certz lint cert.pem --policy mozilla

# Relaxed rules for development certificates
certz lint devcert.pfx --password Pass --policy dev

# All policy sets combined
certz lint cert.pfx --password Pass --policy all

# Fail fast: only surface errors, suppress warnings and info
certz lint cert.pfx --password Pass --severity error

# Lint from Windows certificate store
certz lint ABC123DEF456 --store My

# Machine-readable output
certz lint cert.pfx --password Pass --format json

Options

OptionDefaultDescription
<source>(required)Certificate file path, HTTPS URL, or store thumbprint.
--password, -p(none)Password for PFX/P12 input files.
--policycabfPolicy set to apply. See Policy Sets below.
--severity, -sinfoMinimum severity to report: info, warning, or error.
--storeMyCertificate store name for thumbprint lookups: My, Root, CA.
--location, -lCurrentUserStore location: CurrentUser or LocalMachine.
--formattextOutput format: text or json.
--guidedfalseLaunch the interactive wizard for lint. Prompts for source, policy, and severity.

Policy Sets

PolicyIncludesWhen to use
cabf (default)CA/B Forum Baseline RequirementsAny certificate you deploy to a web server or trust store
mozillaCA/B Forum BR + Mozilla NSS rulesCAs intended for Firefox or the Mozilla Root Program
devRelaxed development-specific checksLocal development only -- not for production
allAll three policy sets combinedThorough audit before any deployment

See Compliance Standards for background on what each standard covers and who enforces it.


Lint Rules

Findings are ordered by severity (errors first), then by rule ID.

CA/B Forum Baseline Requirements (cabf)

Rule IDRuleSeverityApplies toTrigger
BR-001Maximum Validity PeriodErrorLeaf certsValidity > 398 days
BR-003RSA Key SizeErrorAllRSA key < 2048 bits
BR-004ECDSA Key SizeErrorAllECDSA key < P-256 (256 bits)
BR-005SHA-1 Signature ProhibitedErrorAllSignature algorithm uses SHA-1
BR-007Subject Alternative Name RequiredErrorLeaf certsSAN extension absent
BR-008CN Must Be In SANWarningLeaf certsCN value does not appear in SAN list
BR-009Basic Constraints Required for CAErrorCA certsBasicConstraints extension absent
BR-009Basic Constraints Must Be CriticalWarningCA certsBasicConstraints present but not marked critical
BR-010CA Key Usage (keyCertSign)ErrorCA certskeyCertSign flag absent from Key Usage
BR-010Key Usage RecommendedWarningAllKey Usage extension absent entirely
BR-011Extended Key Usage RecommendedInfoLeaf certsEKU extension absent
BR-012Authority Key Identifier RequiredWarningNon-rootAKI extension absent
BR-013Subject Key Identifier RecommendedInfoAllSKI extension absent
BR-015Country Code LengthErrorAllCountry (C) present but not exactly 2 characters
BR-016Organization Requires CountryErrorAllOrganization (O) present but Country (C) absent
BR-017Wildcard PositionErrorLeaf certsWildcard (*) appears outside the leftmost label
BR-019SAN WhitespaceErrorAllSAN dnsName contains leading, trailing, or embedded whitespace
BR-020SAN dnsName LengthErrorAllSAN dnsName exceeds 253 characters or any label exceeds 63 characters (RFC 1035)
BR-021SAN dnsName SyntaxErrorAllSAN dnsName contains an empty label, a hyphen at the start or end of a label, or a non-LDH character (RFC 1035 preferred-name-syntax; wildcard exempt)
BR-022IP Literal in dnsName SANWarningAllIP literal placed in dnsName SAN; should be an iPAddress SAN entry (RFC 6125 sec 6.4)
BR-023Duplicate SANWarningAllThe same SAN value appears more than once (case-insensitive)

Mozilla NSS Policy (mozilla)

Includes all CA/B Forum rules above, plus:

Rule IDRuleSeverityApplies toTrigger
NSS-002Root CA Maximum ValidityWarningRoot CAsRoot CA validity > 25 years
NSS-003Intermediate CA Maximum ValidityWarningIntermediate CAsIntermediate CA validity > 10 years
NSS-004Name Constraints RecommendedInfoIntermediate CAsNameConstraints extension absent
NSS-005Revocation Information RequiredWarningIntermediate CAsNeither CRL Distribution Points nor AIA (OCSP) present

Development Policy (dev)

Relaxed checks intended for local development certificates only:

Rule IDRuleSeverityApplies toTrigger
DEV-001Long ValidityWarningLeaf certsValidity > 398 days
DEV-003Local Development SANsInfoLeaf certslocalhost or 127.0.0.1 absent from SANs

Note: The dev policy never produces errors. Use cabf before deploying to any shared or production environment.


Severity Levels

SeverityMeaningEffect on exit code
infoBest-practice suggestionNone -- exit code 0
warningDeviation from recommended practiceNone -- exit code 0
errorCompliance failure -- cert will be rejected by browsers or CAsExit code 1

Only error-severity findings cause a non-zero exit code. Use --severity error to suppress warnings and info in output entirely:

certz lint cert.pfx --password Pass --severity error
echo "Exit: $?"   # 0 = clean, 1 = errors found

Using lint in CI/CD

Fail-fast check

certz lint cert.pfx --password "$PFX_PASS" --severity error
if [ $? -ne 0 ]; then
  echo "Certificate has compliance errors. Blocking deployment."
  exit 1
fi

GitHub Actions

- name: Lint TLS certificate
  run: certz lint cert.pfx --password "${{ secrets.PFX_PASS }}" --severity error

Parse JSON findings

# Show only error messages
certz lint cert.pfx --password Pass --format json \
  | jq '.findings[] | select(.severity == "Error") | .message'

# Count errors
certz lint cert.pfx --password Pass --format json | jq '.errorCount'

JSON Output Schema

certz lint cert.pfx --password Pass --format json

Example output:

{
  "subject": "CN=api.local",
  "thumbprint": "A1B2C3D4E5F6...",
  "passed": false,
  "policySet": "cabf",
  "isCa": false,
  "isRoot": false,
  "sourcePath": "cert.pfx",
  "errorCount": 1,
  "warningCount": 2,
  "infoCount": 1,
  "findings": [
    {
      "ruleId": "BR-001",
      "ruleName": "Maximum Validity Period",
      "severity": "Error",
      "message": "Leaf certificate validity exceeds 398 days (CA/B Forum limit)",
      "policy": "CA/B Forum BR",
      "actualValue": "730 days",
      "expectedValue": "<= 398 days"
    },
    {
      "ruleId": "BR-010",
      "ruleName": "Key Usage Recommended",
      "severity": "Warning",
      "message": "Key Usage extension is recommended",
      "policy": "CA/B Forum BR",
      "actualValue": null,
      "expectedValue": null
    }
  ]
}

Top-level fields:

FieldTypeDescription
subjectstringSubject DN of the linted certificate
thumbprintstringSHA-1 thumbprint (hex, no colons)
passedbooltrue when no error-severity findings exist
policySetstringPolicy applied: cabf, mozilla, dev, or all
isCabooltrue if BasicConstraints has CA=true
isRootbooltrue if subject equals issuer (self-signed)
sourcePathstring or nullFile path or URL that was linted
errorCountintNumber of error-severity findings
warningCountintNumber of warning-severity findings
infoCountintNumber of info-severity findings
findingsarrayAll findings matching the --severity filter, errors first

Each finding:

FieldTypeDescription
ruleIdstringRule identifier: BR-001, NSS-003, DEV-001, etc.
ruleNamestringShort human-readable rule name
severitystring"Error", "Warning", or "Info"
messagestringFull description of the violation
policystringPolicy that defines this rule
actualValuestring or nullValue found in the certificate (where applicable)
expectedValuestring or nullRequired or recommended value (where applicable)

Troubleshooting

ProblemLikely causeFix
BR-007: SAN requiredCertificate created by a tool that does not add a SAN extensionRecreate with certz create dev -- certz always adds SANs automatically. See Subject Alternative Names.
BR-001: Validity error on a CA certCA cert linted with cabf; the 398-day rule applies to leaf certs onlyVerify isCa is true in JSON output. If it is, this finding is a certz bug -- please report it.
BR-003/BR-004: Key size errorCertificate generated with a legacy tool using RSA-1024 or small ECDSARegenerate with certz create dev (defaults to ECDSA P-256). See RSA vs ECDSA.
All findings are warnings but exit code is 1Not possible -- only errors produce exit code 1Run without --severity error to see the full finding list; one of them is an error.
NSS-002/NSS-003 warnings on local CAInternal CA linted with mozilla or all; NSS validity guidance targets public CAsExpected for internal use. Switch to --policy cabf or --policy dev for local-only CAs.