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

Copy Markdown View Source

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

Summary

Functions

Decodes an exact public Ed25519 OKP JWK.

Encodes one 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.

encode_public(public_key, limits)

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

Encodes one 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.