Skip to main content

Module thumbprint

Module thumbprint 

Source
Expand description

RFC 9679 COSE Key Thumbprints.

A COSE Key Thumbprint is a deterministic hash of a COSE_Key — the COSE analogue of the JWK thumbprint (RFC 7638). It is computed by:

  1. Collecting only the parameters required for that key type (e.g. for an OKP key kty, crv, and x), excluding kid, key_ops, and any private material.
  2. Encoding those parameters as a CBOR map using the deterministic encoding of RFC 8949 §4.2.1 (definite-length map, shortest-form integers, map keys sorted bytewise-lexicographically by their encoded bytes).
  3. Hashing the result. This implementation only supports the RFC 9679 default hash, SHA-256.

Because the thumbprint is computed over public material for asymmetric keys, a private key and its corresponding public key produce the same thumbprint. The same applies for signature key pairs / their verification key.

Structs§

CoseKeyThumbprint
An RFC 9679 COSE Key Thumbprint.

Traits§

CoseKeyThumbprintExt
Computes the RFC 9679 COSE Key Thumbprint of a key.

Functions§

encoded_label 🔒
Returns the CBOR encoding of an integer label, used as the sort key for canonical ordering.
thumbprint_from_required_params 🔒
Builds the RFC 9679 thumbprint from a key type’s required parameters.