BoundedAuthorityProtocol.V1.Jwk (Bounded Authority Protocol v0.8.0)

Copy Markdown View Source

Exact public Ed25519 JWK encoding, decoding, and RFC 7638 thumbprints.

Every documented function here refuses a key that fails BoundedAuthorityProtocol.Ed25519.acceptable_public_key?/1 (non-canonical, small-order or off-curve) with the closed {:error, :invalid}, so no such key can enter a JWK, a holder confirmation thumbprint, or a key fingerprint.

Summary

Functions

Decodes an exact public Ed25519 OKP JWK carrying an acceptable key.

Encodes one acceptable raw 32-byte Ed25519 public key as the canonical public OKP JWK.

Returns the canonical base64url RFC 7638 thumbprint.

Returns the exact RFC 7638 public OKP thumbprint preimage.

Functions

decode_public(jwk, limits)

@spec decode_public(binary(), BoundedAuthorityProtocol.V1.Bounds.t() | map()) ::
  {:ok, binary()} | {:error, :invalid}

Decodes an exact public Ed25519 OKP JWK carrying an acceptable key.

encode_public(public_key, limits)

@spec encode_public(binary(), BoundedAuthorityProtocol.V1.Bounds.t() | map()) ::
  {:ok, binary()} | {:error, :invalid}

Encodes one acceptable raw 32-byte Ed25519 public key as the canonical public OKP JWK.

thumbprint(jwk, limits)

@spec thumbprint(binary(), BoundedAuthorityProtocol.V1.Bounds.t() | map()) ::
  {:ok, binary()} | {:error, :invalid}

Returns the canonical base64url RFC 7638 thumbprint.

thumbprint_preimage(jwk, limits)

@spec thumbprint_preimage(binary(), BoundedAuthorityProtocol.V1.Bounds.t() | map()) ::
  {:ok, binary()} | {:error, :invalid}

Returns the exact RFC 7638 public OKP thumbprint preimage.