X.509 certificate inspection from PEM

$0.005 USDC per call · Business, finance and compliance · POST /api/v1/x509-inspect · Id x509-inspect

Takes a PEM-encoded X.509 certificate and returns its fields (subject, issuer, serial, validity window, SANs, key usage, EKU, basic constraints, signature algorithm, public key algorithm and bit size) plus a fail-on-issue audit: expired or not-yet-valid, hostname/SAN mismatch per RFC 6125 §6.4.3 wildcards, weak signature (SHA-1), short RSA (<2048), serverAuth without SAN (CABF BR 7.1.4.2.1). Decodes DER with an inline ASN.1 walker, so it runs on Cloudflare Workers with no external library.

What you get

Expired-cert outages are preventable; this is the one-call audit that CI can run on every new PEM a deploy pins or a secret store receives.

Call it

Send the JSON body below to https://agents.writerslogic.com/api/v1/x509-inspect. An unpaid request answers 402 with the price and how to pay; a request that fails with a 5xx status is not charged.

curl -i -X POST https://agents.writerslogic.com/api/v1/x509-inspect \
  -H 'content-type: application/json' \
  -d '{"pem":"-----BEGIN CERTIFICATE-----\nMIIB...=\n-----END CERTIFICATE-----","hostname":"example.com"}'

Input

FieldTypeRequiredDescription
pemstring; length 0..200000yesA PEM block beginning with '-----BEGIN CERTIFICATE-----'.
hostnamestring; length 0..255noOptional hostname to check against the certificate's SANs.
nowIsostring; length 0..40noOverride 'now' for deterministic tests.
intermediatesarray<string>; max 10 itemsnoIntermediate certs (PEM) between leaf and anchor.
trustAnchorsarray<string>; max 20 itemsnoTrust anchors (PEM). When present, chain cryptographic verification runs.
maxChainDepthintegernoChain depth cap (default 8).

Example request body

{
  "pem": "-----BEGIN CERTIFICATE-----\nMIIB...=\n-----END CERTIFICATE-----",
  "hostname": "example.com"
}

Result

The response is { "data": ..., "_provenance": ... }. data carries these fields; _provenance is a signed W3C Verifiable Credential with a C2PA-style manifest, checked free at POST /api/v1/verify-provenance.

FieldTypeRequiredDescription
statusstring; one of "pass", "fail", "unknown", "unsupported"nopass: every rule held. fail: a rule was violated (see witnesses). unknown: the input lacks the evidence to decide. unsupported: outside what this engine covers. Missing evidence is never a pass.
validbooleanno
subjectstringno
issuerstringno
serialstringno
notBeforestringno
notAfterstringno
subjectAltNamesarray<string>no
keyUsagearray<string>no
extendedKeyUsagearray<string>no
signatureAlgorithmstringno
publicKeyobjectno
basicConstraintsobjectno
hostnameMatchbooleanno
daysUntilExpiryintegerno
signatureAlgorithmOidstringno
publicKeyCurvestringno
chainobjectnoPresent when trustAnchors is supplied: valid, depth, subject-path and failure reason.
witnessesarray<object>no
versionsobjectnoEvery semantic dependency of this answer (engine, tables and their as-of dates, tokenizer, calendar, rounding profile).
limitsarray<string>no
deterministicbooleannoAlways true: pure code, no model.

Pay and connect

Available through: x402 (USDC on Base), MCP. MCP clients reach it through the identifier-text-kit package.

Machine-readable