xtract.bot

POST /api/x509-decode1 quota unit per call · cache hits free

Inspect an X.509 certificate without OpenSSL. Returns subject, issuer, validity period, serial, public-key algorithm + bits, Subject Alternative Names, and key-usage extensions. Accepts PEM or DER input.

Parses a PEM- or DER-encoded X.509 certificate and returns the human-readable fields. Useful for: - Diagnosing a TLS cert (expiry, SAN list). - Auditing an mTLS client cert. - Pulling subject info out of a downloaded `.crt` / `.pem`. **Output:** JSON with `subject`, `issuer`, `serialHex`, `notBefore`, `notAfter`, `publicKey` (algorithm + bits), `subjectAlternativeNames`, `keyUsage`, `extendedKeyUsage`, `signatureAlgorithm`, and `fingerprintSha256` (hex).

Inputs

NameTypeDefaultDescription
certificate*stringX.509 certificate as PEM (-----BEGIN CERTIFICATE-----) or base64-encoded DER.

Response

Modes: json. Cache: yes (24h TTL).

Every response carries x-cache (HIT / MISS / BYPASS), x-cache-signature (stable across identical inputs), and the rate-limit headers listed below.

Quota & limits

Cost per call1 unit against the 10,000-unit monthly quota. Cache hits are free — only cache misses decrement.
Burst limit200 requests per rolling minute, shared across all tools.
Max request size64 KiB (base64 inflates file payloads ~33% — the limit applies to the decoded bytes).
Max response size32 KiB
Timeout10s wall clock.
Rate-limit headersX-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Burst-Limit on every response; X-Quota-Warning once 80% of the monthly quota is spent; Retry-After on 429s.

Errors

Errors are JSON with an error string; schema failures add a details object (Zod's flattened field errors).

StatusWhenBody
400Input fails the tool's schema (wrong type, missing required field, malformed base64) or the file bytes can't be parsed as the expected format.{ "error": "invalid inputs", "details": { "fieldErrors": { … } } }
401Missing or invalid X-Api-Key / X-Account-Id headers (or no session when called from the browser).{ "error": "unauthorized" }
404Unknown tool id, or calling /api/* on the website hostname instead of api.xtract.bot.{ "error": "not found" }
413Request body over the tool's max request size, or an image header declaring more megapixels than the tool's pixel budget.{ "error": "…exceeds maxRequestBytes…" }
415Content-Type isn't application/json on the json-body transport.{ "error": "unsupported content-type; expected application/json" }
429Monthly quota or the 200/min burst limit exhausted. Check Retry-After and the X-RateLimit-* headers.{ "error": "monthly quota exceeded", "monthRemaining": 0, … }
5xxConversion engine failure. Safe to retry; if it persists, the input is hitting a bug — please report it.{ "error": "…" }

Code samples

Built from the self-signed example.


curl -X POST https://api.xtract.bot/api/x509-decode \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -H "X-Account-Id: $XTRACT_ACCOUNT_ID" \
  -H "X-Api-Key: $XTRACT_API_KEY" \
  -d '{
  "certificate": "-----BEGIN CERTIFICATE-----\nMIIDjDCCAnSgAwIBAgIUU743qAP4Zxv7bym5htY3c/ua6QwwDQYJKoZIhvcNAQEL\nBQAwPDEYMBYGA1UEAwwPZGVtby54dHJhY3QuYm90MRMwEQYDVQQKDAp4dHJhY3Qu\nYm90MQswCQYDVQQGEwJBVTAeFw0yNjA2MTEwOTUwMjJaFw0zNjA2MDgwOTUwMjJa\nMDwxGDAWBgNVBAMMD2RlbW8ueHRyYWN0LmJvdDETMBEGA1UECgwKeHRyYWN0LmJv\ndDELMAkGA1UEBhMCQVUwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCO\n+Tokrkjy6Egb/irJHkLzlTm2vebJHKThQvP/zRP+izzKqFb12ijLhDH5uTRTn0aD\naAyV4vyqKRJSQHwmWRCywAWHX1Y334JZ8K+1dDALT9BgEEp0N8dMt2xf14ngKUlb\nCfHK+vpvj18h/yr1n1Pqj9sqQkZy7aPKBaZWy+QZ/EAC04t+TvgFgCy4Wu3XDKf8\nPi407KqvMHAGCuozFl6aNIwZNiQYw3h7qagD+XaQrnIy5RnOW+Cjx4ae+r5jAzW8\nFLL6/5fixfBFw8Tsy/RQ6ZVCsd07eIoYtMZSxdLdxt46MBUfJshYK2Qmy++oMcN/\nVQF7+muKd7VfEs3G8+ZDAgMBAAGjgYUwgYIwHQYDVR0OBBYEFG1RZ7Bqne7RO4qJ\nP7L2nyjr8QkLMB8GA1UdIwQYMBaAFG1RZ7Bqne7RO4qJP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