Signatures Certificates

cyber-posts

Digital Signatures in Certificates and Credentials: X.509 vs. CVC

Digital signatures are the core mechanism that makes certificates trustworthy in identity and credential systems. They ensure authenticity (the certificate really comes from the claimed issuer), integrity (the content hasn’t been tampered with), and non-repudiation (the issuer can’t deny having issued it).

How a Digital Signature Works (General Principle)

  1. The issuer creates the certificate data (subject identity, public key, validity dates, authorizations, etc.).
  2. This data (or a specific “to-be-signed” portion) is hashed using a cryptographic hash function (e.g., SHA-256 or SHA-3).
  3. The hash is encrypted with the issuer’s private key → this encrypted hash is the signature.
  4. The signature is attached to the certificate.
  5. To verify:
  • Compute the hash of the received certificate data.
  • Decrypt the signature using the issuer’s public key.
  • Compare the two hashes. If they match → valid signature.

This is the same fundamental process for both X.509 and CVC, but the structure, encoding, and use cases differ.

X.509 Certificates

  • Standard: ITU-T X.509 (most widely used public key certificate format).
  • Use cases in your domain: TLS/SSL server certificates, client certificates, code signing, S/MIME email, enterprise PKI for user authentication, many verifiable credential systems (when using traditional PKI).
  • Structure relevant to signatures:
  • Three main parts:
    1. TBSCertificate (To Be Signed Certificate) – contains version, serial number, issuer, subject, public key, validity, extensions, etc.
    2. signatureAlgorithm – identifies the algorithm (e.g., sha256WithRSAEncryption, ecdsa-with-SHA256).
    3. signatureValue – the actual signature bits (the encrypted hash of the TBSCertificate).
  • Encoding: ASN.1 DER (strict binary encoding).
  • Signature process:
  • Hash only the TBSCertificate (not the signature fields).
  • Sign with issuer’s private key.
  • Common algorithms: RSA-PKCS#1 v1.5, RSA-PSS, ECDSA (with NIST or Brainpool curves).
  • Libraries you’ll use: OpenSSL, Bouncy Castle, Java’s java.security.cert, Python’s cryptography or pyOpenSSL.

Card Verifiable Certificates (CVC)

  • Standard: Defined in ISO/IEC 7816-8 and BSI TR-03110 (German Federal Office for Information Security).
  • Use cases in your domain: Smart card-based identity systems, especially European eID cards, ePassports (EAC – Extended Access Control), government-issued credentials where the card itself performs verification (offline, constrained environment).
  • Key differences from X.509:
  • Designed for resource-constrained devices (smart cards).
  • Focus on role-based authorization rather than general identity.
  • Shorter chain length, often self-described references (CAR = Certificate Authority Reference, CHR = Certificate Holder Reference).
  • Structure relevant to signatures:
  • TLV (Tag-Length-Value) encoding (BER-TLV, more flexible than DER).
  • Profile Identifier, CAR, Public Key, CHR, Certificate Holder Authorization Template (CHAT – defines roles/permissions), validity dates, optional extensions, and outer signature.
  • No separate TBSCertificate block – the signature is over the entire certificate body (all fields except the signature itself).
  • Signature process:
  • Concatenate the body fields in defined order.
  • Hash and sign with issuer’s private key (almost always ECDSA for performance on cards).
  • Common curves: BrainpoolP256r1, BrainpoolP384r1, or NIST P-256.
  • Chain: Starts from a root CVCA (often linked to an X.509 CSCA), then DV (Document Verifier) certificates, then terminal/IS certificates – all in CVC format after the root.
  • Libraries/tools: Less common than X.509. Often BSI libraries, OpenSC, or custom implementations in JavaCard/GlobalPlatform environments.

Quick Comparison Table

AspectX.509CVC (Card Verifiable Certificate)
Primary UseGeneral PKI, web, enterpriseSmart cards, eID, ePassport EAC
EncodingASN.1 DER (strict)BER-TLV (flexible)
Signed DataTBSCertificate onlyEntire body except signature
Typical AlgorithmsRSA or ECDSAAlmost always ECDSA (card-friendly)
Authorization ModelExtensions (e.g., SAN, EKU)CHAT field (role-based, bitmask)
Chain LengthCan be longUsually very short (1–3 levels)
Verification LocationAnywhere (online/offline)Often on the card itself (offline)
Standard BodiesITU-T, IETF (RFC 5280)ISO/IEC 7816, BSI TR-03110

Why This Matters for Your Job

  • In identity/credential systems, you’ll often need to issue, verify, or chain both types.
  • Modern systems sometimes bridge them: an X.509 CSCA root signs a CVC chain for ePassport access control.
  • When implementing verification services, remember that CVC requires stricter parsing of TLV structures and specific OID handling.
  • Performance tip: ECDSA verification is much faster than RSA on constrained devices → prefer ECDSA when designing new credential formats.

Spend your 10 minutes today mentally walking through a verification flow: take a real client certificate (X.509) in your browser, view it, and trace the signature fields. Then look up a BSI TR-03110 example CVC (public test data exists) and compare the structure.

Next time you ask about a related topic (e.g., specific algorithms, revocation, or verifiable credentials with JSON-LD signatures), I’ll connect it back to this foundation.

Leave a Reply

Your email address will not be published. Required fields are marked *