API reference

Decode certificates and CSRs

Decode X.509 certificates, chains, and certificate requests.

GETPOST/api/cert/decodeMCP tool cert_decode

Decodes every certificate (PEM, DER, Base64 DER, or PKCS#7 bundle) and CSR in the input. For chains it checks, for each adjacent pair, that the issuer name matches and that the signature verifies with the next certificate's key. With hostname it reports which certificates cover that name under RFC 6125 wildcard rules. It does not establish trust: there is no root store, and revocation (OCSP/CRL) is not checked. Every key and certificate is also checked against the keys compromised in the October 2026 eMudhra (emSign) incident (all eight intermediate CA keys, whose private keys are public, and the emSign ECC Root CA - G3 removed from browser trust stores), and a certificate signed by one of them is flagged after verifying the signature with that key. NIST-curve EC keys are also searched for a tiny private value (the eMudhra failure mode), so a key with that weakness is caught even if it is on no list: the API tries private values 1 to 256 and their negations; the web page tries every value below 2^32.

Browser version (runs locally): Certificate Decoder.

Try it

Credentials
Remember these credentials

Not saved: you will paste them again next time.

No credentials yet? Get a client ID and secret. They are sent only to this site, in an Authorization: Basic header.

POST /api/cert/decode with a JSON body

Parameters

ParameterTypeDefaultDescription
inputstring—PEM text (one or more blocks) or Base64 DER. Use exactly one of input, input_base64, or a file upload (.pem, .crt, .cer, .der, .p7b, .csr).
input_base64string—Data as Base64 (either alphabet), for binary content over JSON or MCP.
hostnamestring (≤ 253 chars)—Report whether each certificate's DNS SANs cover this host name.
atstring—Evaluate validity at this ISO 8601 time instead of now, e.g. 2026-01-01T00:00:00Z.

Also accepted on every endpoint: format (json | text). Parameters may come from the query string, a JSON object body, an urlencoded or multipart form, or (for input) a text/plain body. Binary data can be uploaded as a multipart file field or an application/octet-stream body.

Global parameters
ParameterTypeDefaultDescription
formatjson | textjsonjson returns the documented object. text returns only the primary value as text/plain (see "Text output").

Response 200 application/json

FieldTypeDescription
certificatesarray of objectCertificates in input order (leaf first in a well-ordered chain).
certificates[].subjectstringSubject distinguished name (RFC 4514 string).
certificates[].issuerstringIssuer distinguished name.
certificates[].serialNumberstringSerial number as colon-separated uppercase hex.
certificates[].signatureAlgorithmstringSignature algorithm, e.g. RSA PKCS#1 v1.5 with SHA-256.
certificates[].validityobject
certificates[].validity.notBeforestringISO 8601 UTC.
certificates[].validity.notAfterstringISO 8601 UTC.
certificates[].validity.status"valid" | "expired" | "not-yet-valid"Relative to at (default: now).
certificates[].validity.daysRemainingintegerWhole days until notAfter; negative once expired.
certificates[].publicKeyobject
certificates[].publicKey.algorithmstringRSA, EC, Ed25519, X25519, or the algorithm OID name.
certificates[].publicKey.bitsinteger | nullKey size in bits (RSA modulus, EC field size).
certificates[].publicKey.curvestring | nullNamed curve for EC keys (P-256, …).
certificates[].publicKey.spkiSha256stringRFC 7469 pin: Base64(SHA-256(SubjectPublicKeyInfo)).
certificates[].subjectAltNamesarray of objectSubject alternative names.
certificates[].subjectAltNames[].typestringdns, ip, email, url, dn, …
certificates[].subjectAltNames[].valuestringThe name.
certificates[].keyUsagearray of stringKey usage extension bits.
certificates[].extendedKeyUsagearray of stringExtended key usage purposes.
certificates[].basicConstraintsobject | null
certificates[].basicConstraints.cabooleanWhether this is a CA certificate.
certificates[].basicConstraints.pathLengthinteger | nullMax intermediate CAs below this one.
certificates[].subjectKeyIdstring | nullSubject key identifier, hex.
certificates[].authorityKeyIdstring | nullAuthority key identifier, hex.
certificates[].ocsparray of stringOCSP responder URLs (AIA).
certificates[].caIssuersarray of stringIssuer certificate URLs (AIA).
certificates[].crlDistributionPointsarray of stringCRL URLs.
certificates[].policiesarray of stringCertificate policies (DV/OV/EV are named).
certificates[].embeddedSctsbooleanTrue when Certificate Transparency SCTs are embedded.
certificates[].selfSignedbooleanTrue when subject equals issuer and the signature verifies with its own key.
certificates[].fingerprintsobject
certificates[].fingerprints.sha1stringSHA-1 of the DER, colon hex.
certificates[].fingerprints.sha256stringSHA-256 of the DER, colon hex.
certificates[].pemstringThe certificate re-encoded as PEM.
certificates[].advisoriesarray of objectKey trust advisories: known compromised or distrusted keys (the October 2026 eMudhra/emSign compromise), certificates they signed (confirmed by verifying the signature), and EC keys whose private value is tiny. Empty when nothing was found.
certificates[].advisories[].code"compromised-key" | "signed-by-compromised-key" | "distrusted-root" | "issued-by-distrusted-root" | "compromised-ca-parent" | "weak-private-key"What was found.
certificates[].advisories[].severity"critical" | "high" | "warning"critical: anyone can sign as this key. high: browsers no longer trust it. warning: context.
certificates[].advisories[].messagestringPlain-language explanation.
certificates[].advisories[].keystring | nullName of the known key involved, e.g. EM OV TLS CA - G3C.
certificates[].advisories[].incidentstring | nullIncident identifier, e.g. emudhra-2026-10.
certificates[].advisories[].referencesarray of stringPublic sources.
chainobject
chain.linksarray of objectOne link per adjacent pair.
chain.links[].childintegerIndex of the certificate.
chain.links[].parentintegerIndex of the next certificate.
chain.links[].issuerNameMatchesbooleanchild.issuer equals parent.subject.
chain.links[].signatureValidbooleanchild's signature verifies with parent's public key.
chain.orderedbooleanEvery link matches by name and signature.
chain.endsAtSelfSignedbooleanThe last certificate is self-signed (a root).
chain.notesarray of stringProblems and observations about the chain.
requestsarray of objectCertificate signing requests (PKCS#10).
requests[].subjectstringRequested subject DN.
requests[].signatureAlgorithmstringSignature algorithm.
requests[].signatureValidbooleanThe CSR self-signature verifies (proves possession of the private key).
requests[].publicKeyobject
requests[].publicKey.algorithmstringRSA, EC, Ed25519, X25519, or the algorithm OID name.
requests[].publicKey.bitsinteger | nullKey size in bits (RSA modulus, EC field size).
requests[].publicKey.curvestring | nullNamed curve for EC keys (P-256, …).
requests[].publicKey.spkiSha256stringRFC 7469 pin: Base64(SHA-256(SubjectPublicKeyInfo)).
requests[].subjectAltNamesarray of objectSubject alternative names.
requests[].subjectAltNames[].typestringdns, ip, email, url, dn, …
requests[].subjectAltNames[].valuestringThe name.
requests[].pemstringThe request re-encoded as PEM.
requests[].advisoriesarray of objectKey trust advisories: known compromised or distrusted keys (the October 2026 eMudhra/emSign compromise), certificates they signed (confirmed by verifying the signature), and EC keys whose private value is tiny. Empty when nothing was found.
requests[].advisories[].code"compromised-key" | "signed-by-compromised-key" | "distrusted-root" | "issued-by-distrusted-root" | "compromised-ca-parent" | "weak-private-key"What was found.
requests[].advisories[].severity"critical" | "high" | "warning"critical: anyone can sign as this key. high: browsers no longer trust it. warning: context.
requests[].advisories[].messagestringPlain-language explanation.
requests[].advisories[].keystring | nullName of the known key involved, e.g. EM OV TLS CA - G3C.
requests[].advisories[].incidentstring | nullIncident identifier, e.g. emudhra-2026-10.
requests[].advisories[].referencesarray of stringPublic sources.
hostnameobject | null
hostname.namestringHost name checked.
hostname.coveredByarray of integerCertificates whose DNS SANs match.
trustobject
trust.advisoriesarray of objectKey trust advisories: known compromised or distrusted keys (the October 2026 eMudhra/emSign compromise), certificates they signed (confirmed by verifying the signature), and EC keys whose private value is tiny. Empty when nothing was found.
trust.advisories[].code"compromised-key" | "signed-by-compromised-key" | "distrusted-root" | "issued-by-distrusted-root" | "compromised-ca-parent" | "weak-private-key"What was found.
trust.advisories[].severity"critical" | "high" | "warning"critical: anyone can sign as this key. high: browsers no longer trust it. warning: context.
trust.advisories[].messagestringPlain-language explanation.
trust.advisories[].keystring | nullName of the known key involved, e.g. EM OV TLS CA - G3C.
trust.advisories[].incidentstring | nullIncident identifier, e.g. emudhra-2026-10.
trust.advisories[].referencesarray of stringPublic sources.
trust.blockedbooleanTrue when any advisory is critical or high: do not trust these certificates, whatever else says they are valid.

Errors

Errors are JSON: {"error": "<message>", "code": "<code>", "param": "<name>"?}.

StatusCodeWhen
400invalid_parameterat is not a valid date, or more than one data source is given.
422unprocessable_inputNo certificate or CSR is found, the data is malformed, or the input contains a private key (refused).
400missing_parameterA required parameter is absent.
400unknown_parameterA parameter name is not in the table above (typos are rejected, not ignored).
413payload_too_largeThe request body exceeds 1 MiB.
405method_not_allowedA method other than GET, POST or OPTIONS.

Behaviour

  • Idempotent: the same arguments always return the same result.
  • Requires a client ID and secret (authentication). Each call is recorded as one metadata row against your client ID; inputs and outputs are never stored or logged. Responses carry cache-control: no-store.
  • CORS: any origin may call this endpoint from a browser, using your credentials.

Examples

Responses below were produced by running each request through this code at build time. Long strings are shortened.

Self-signed certificate, checking a host name

curl -X POST 'https://util.caruana.me/api/cert/decode' \
  -H 'content-type: application/json' \
  -d '{"input":"-----BEGIN CERTIFICATE-----\nMIIBYDCCARKgAwIBAgIQcuMlZ0gk8qldBRVY4uV0BTAFBgMrZXAwFjEUMBIGA1UE\nAxMLZXhhbXBsZS5jb20wHhcNMjYxMDE0MDA1MjM5WhcNMjcxMDE0MDA1MjM5WjAW\nMRQwEgYDVQQDEwtleGFtcGxlLmNvbTAqMAUGAytlcAMhAHGVluSiNj6bqXsllRWY\nUFXc2JNxW9mDP9PntMYyVHeMo3YwdDAMBgNVHRMBAf8EAjAAMA4GA1UdDwEB/wQE\nAwIHgDAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwHQYDVR0OBBYEFAmd\nd/YA6wQehHCnkI05mwtULXOMMBYGA1UdEQQPMA2CC2V4YW1wbGUuY29tMAUGAytl\ncANBAKbfzTFPGlLacXH+cIikicbI4CSvJj/ZkCgMWJNjq649UzUHvJvhe2rQoLwM\nDFaoibsbMY3x6ucpRzC+yl9t7ww=\n-----END CERTIFICATE-----\n","hostname":"example.com"}'

Response 200

{
  "certificates": [
    {
      "subject": "CN=example.com",
      "issuer": "CN=example.com",
      "serialNumber": "72:E3:25:67:48:24:F2:A9:5D:05:15:58:E2:E5:74:05",
      "signatureAlgorithm": "Ed25519",
      "validity": {
        "notBefore": "2026-10-14T00:52:39.000Z",
        "notAfter": "2027-10-14T00:52:39.000Z",
        "status": "valid",
        "daysRemaining": 352
      },
      "publicKey": {
        "algorithm": "Ed25519",
        "bits": 256,
        "curve": null,
        "spkiSha256": "TbzBk4Wus+EGmXKtvddPRWHXoFXx92/Z3awNPz3Vo9g="
      },
      "subjectAltNames": [
        {
          "type": "dns",
          "value": "example.com"
        }
      ],
      "keyUsage": [
        "digitalSignature"
      ],
      "extendedKeyUsage": [
        "TLS server authentication",
        "TLS client authentication"
      ],
      "basicConstraints": {
        "ca": false,
        "pathLength": null
      },
      "subjectKeyId": "099D77F600EB041E8470A7908D399B0B542D738C",
      "authorityKeyId": null,
      "ocsp": [],
      "caIssuers": [],
      "crlDistributionPoints": [],
      "policies": [],
      "embeddedScts": false,
      "selfSigned": true,
      "fingerprints": {
        "sha1": "CE:B5:7C:D3:DE:FB:06:99:18:CE:D4:CE:60:7E:32:8A:8F:52:9A:8A",
        "sha256": "E2:A2:01:81:60:37:51:F3:4A:8A:C8:6E:59:EA:86:5C:1B:09:CA:32:70:9D:33:31:EC:AD:E5:45:AC:89:47:E8"
      },
      "pem": "-----BEGIN CERTIFICATE-----\nMIIBYDCCARKgAwIBAgIQcuMlZ0gk8qldBRVY4uV0BTAFBgMrZXAwFjEUMBIGA1UE\nAxMLZXhhbXBsZS5jb20wHhcNMjY… (418 more characters)",
      "advisories": []
    }
  ],
  "chain": {
    "links": [],
    "ordered": true,
    "endsAtSelfSigned": true,
    "notes": []
  },
  "requests": [],
  "hostname": {
    "name": "example.com",
    "coveredBy": [
      0
    ]
  },
  "trust": {
    "advisories": [],
    "blocked": false
  }
}
Same call as an MCP tools/call
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "cert_decode",
    "arguments": {
      "input": "-----BEGIN CERTIFICATE-----\nMIIBYDCCARKgAwIBAgIQcuMlZ0gk8qldBRVY4uV0BTAFBgMrZXAwFjEUMBIGA1UE\nAxMLZXhhbXBsZS5jb20wHhcNMjYxMDE0MDA1MjM5WhcNMjcxMDE0MDA1MjM5WjAW\nMRQwEgYDVQQDEwtleGFtcGxlLmNvbTAqMAUGAytlcAMhAHGVluSiNj6bqXsllRWY\nUFXc2JNxW9mDP9PntMYyVHeMo3YwdDAMBgNVHRMBAf8EAjAAMA4GA1UdDwEB/wQE\nAwIHgDAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwHQYDVR0OBBYEFAmd\nd/YA6wQehHCnkI05mwtULXOMMBYGA1UdEQQPMA2CC2V4YW1wbGUuY29tMAUGAytl\ncANBAKbfzTFPGlLacXH+cIikicbI4CSvJj/ZkCgMWJNjq649UzUHvJvhe2rQoLwM\nDFaoibsbMY3x6ucpRzC+yl9t7ww=\n-----END CERTIFICATE-----\n",
      "hostname": "example.com"
    }
  }
}