Developer Guidance: Use Standard JOSE Implementations (Recommended)

This subsection provides implementation guidance to reduce cryptographic serialization errors.

Implementations SHOULD use a standards-compliant JOSE/JWT implementation (RFC 7515 JWS, RFC 7516 JWE) to generate and validate Compact Serialization tokens.

While this document describes the JWE compact serialization components (e.g., encrypted_key, iv, ciphertext, tag), implementations SHOULD NOT manually construct or parse these components unless there is a strong, validated reason to do so. A JOSE library can correctly produce and validate JWE/JWS tokens when provided with:

  • the protected header (e.g., alg, enc, cty, ver, identifiers)
  • the plaintext payload (Card object / authentication object)
  • the recipient public key (for JWE key management) and the signing private key (for JWS signing)