wire / wire-format / x509-certificate

X.509 certificate (DER) structure

An X.509 v3 certificate is a DER-encoded (ASN.1) structure: TBSCertificate (to-be-signed: version, serial number, signature algorithm, issuer, validity, subject, subject public key info, extensions), signature algorithm identifier, and the signature value. The whole is wrapped in a SEQUENCE.

wire-format kind wire-format status standard verification verified tier B wire-format@1

aka: X.509 certificate (DER) structure

wire format

spec: RFC 5280 (X.509 PKIX)

An X.509 v3 certificate is a DER-encoded (ASN.1) structure: TBSCertificate (to-be-signed: version, serial number, signature algorithm, issuer, validity, subject, subject public key info, extensions), signature algorithm identifier, and the signature value. The whole is wrapped in a SEQUENCE.

fieldsizemeaning
Certificate SEQUENCEvariableOuter SEQUENCE wrapping tbsCertificate, signatureAlgorithm, signatureValue.
tbsCertificatevariableSEQUENCE: version [0] (v3), serialNumber INTEGER, signature AlgorithmIdentifier, issuer Name, validity (notBefore, notAfter), subject Name, subjectPublicKeyInfo, issuerUniqueID [1], subjectUniqueID [2], extensions [3].
signatureAlgorithmvariableAlgorithmIdentifier (OID + parameters) for the signature (e.g. sha256WithRSAEncryption 1.2.840.113549.1.1.11).
signatureValuevariableBIT STRING containing the signature bytes.

example:

30 82 03 00 30 82 02 00 a0 03 02 01 02 02 01 01 30 0d 06 09 2a 86 48 86 f7 0d 01 01 0b 05 00

DER prefix: SEQUENCE { SEQUENCE { [0] version v3, serial 1, sig alg sha256WithRSAEncryption ... } }


provenance

agent: curl -H 'accept: application/json' wire.phall.io/wire-format/x509-certificate or /wire-format/x509-certificate.json