BoundedAuthorityProtocol.V1 (Bounded Authority Protocol v0.1.1)

Copy Markdown View Source

Explicit entry point for the immutable v1 wire profile.

Summary

Functions

Assembles a validated signing input and raw Ed25519 signature at profile maxima.

Assembles a validated signing input and raw Ed25519 signature under caller bounds.

Builds the deterministic standard-JWS boundary-anchor signing input.

Checks a raw nonempty consumption-chain range against mandatory caller boundaries.

Verifies a raw grant-and-proof envelope against server-derived expected context.

Boundedly decodes a raw compact grant without evaluating trust.

Boundedly decodes a raw compact proof without evaluating trust.

Frames an exact deterministic anchored export after semantic validation.

Encodes one exact canonical consumption-chain row.

Builds the deterministic standard-JWS grant signing input.

Builds the deterministic standard-JWS historical-key-transition signing input.

Builds the deterministic standard-JWS holder-proof signing input.

Returns the canonical type-preserving request digest.

Parses only the protected grant header and returns its untrusted kid hint.

Atomically verifies one raw anchored export against caller boundaries and key history.

Verifies one raw compact grant against caller-supplied trust and expected context.

Verifies one raw compact boundary anchor against one exact historical public key.

Verifies one raw compact authenticated historical-key transition.

Functions

assemble_compact(signing_input, signature)

@spec assemble_compact(BoundedAuthorityProtocol.V1.SigningInput.t(), binary()) ::
  {:ok, binary()} | {:error, :invalid}

Assembles a validated signing input and raw Ed25519 signature at profile maxima.

assemble_compact(signing_input, signature, limits)

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

Assembles a validated signing input and raw Ed25519 signature under caller bounds.

boundary_anchor_signing_input(anchor, limits)

Builds the deterministic standard-JWS boundary-anchor signing input.

check_chain(input, expected)

Checks a raw nonempty consumption-chain range against mandatory caller boundaries.

check_envelope(credentials, expected_request)

Verifies a raw grant-and-proof envelope against server-derived expected context.

decode_grant(compact, limits)

Boundedly decodes a raw compact grant without evaluating trust.

decode_proof(compact, limits)

Boundedly decodes a raw compact proof without evaluating trust.

encode_anchored_export(input, expected)

Frames an exact deterministic anchored export after semantic validation.

encode_consumption_entry(entry, limits)

Encodes one exact canonical consumption-chain row.

grant_signing_input(grant, limits)

Builds the deterministic standard-JWS grant signing input.

key_transition_signing_input(transition, limits)

Builds the deterministic standard-JWS historical-key-transition signing input.

proof_signing_input(proof, limits)

Builds the deterministic standard-JWS holder-proof signing input.

request_digest(operation, cast_arguments, limits)

Returns the canonical type-preserving request digest.

untrusted_key_locator(compact, limits \\ %{})

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

Parses only the protected grant header and returns its untrusted kid hint.

The complete compact input is bounded. Payload and signature segments are not decoded, interpreted, or independently size-checked.

verify_anchored_export(archived, key_chain, expected)

Atomically verifies one raw anchored export against caller boundaries and key history.

verify_grant(compact, trusted_issuer, expected_grant)

Verifies one raw compact grant against caller-supplied trust and expected context.

verify_historical_anchor(compact, key, expected_anchor)

Verifies one raw compact boundary anchor against one exact historical public key.

verify_key_transition(compact, current_key, next_key, expected)

Verifies one raw compact authenticated historical-key transition.