CharterAgreementProtocol.SigningInput (Charter Agreement Protocol v0.2.1)

Copy Markdown View Source

CAP never authorizes.

Deterministic attached-JWS framing plus the honest-signer refusal boundary.

Callers provide exactly %{"kid" => kid, "claims" => claims}. This module constructs the closed protected header, canonicalizes and validates the payload through the existing artifact codec, and returns only the exact RFC 7515 signing bytes. The set-aware Acceptance producer refuses false coordinates, equivocation, and ancestry that excludes any maximum accepted head. The set-aware Termination producer refuses every revision except the unique governing revision at the notice's own effective time.

This module never accepts a key, signer, callback, or custody handle and never signs. These refusal checks protect honest signers relative to their supplied view; they cannot constrain a dishonest signer or prove completeness.

Summary

Functions

Build an Acceptance signing input after R1/R2/R3 set refusal checks.

Assemble a validated signing input and exact raw 64-byte signature.

Build a canonical Party Descriptor signing input without signing.

Build a canonical Receipt signing input without signing.

Build a Termination signing input after R1/R2/R3 set refusal checks.

Types

kind()

@type kind() :: :party_descriptor | :acceptance | :termination | :receipt

t()

@type t() :: %CharterAgreementProtocol.SigningInput{
  kind: kind(),
  message: binary(),
  payload_segment: binary(),
  protected_segment: binary()
}

Functions

acceptance(input, set)

@spec acceptance(term(), CharterAgreementProtocol.ArtifactSet.t()) ::
  {:ok, t()} | {:error, CharterAgreementProtocol.Error.t()}

Build an Acceptance signing input after R1/R2/R3 set refusal checks.

assemble(input, signature)

@spec assemble(term(), term()) ::
  {:ok, binary()} | {:error, CharterAgreementProtocol.Error.t()}

Assemble a validated signing input and exact raw 64-byte signature.

descriptor(input)

@spec descriptor(term()) :: {:ok, t()} | {:error, CharterAgreementProtocol.Error.t()}

Build a canonical Party Descriptor signing input without signing.

receipt(input)

@spec receipt(term()) :: {:ok, t()} | {:error, CharterAgreementProtocol.Error.t()}

Build a canonical Receipt signing input without signing.

termination(input, set)

@spec termination(term(), CharterAgreementProtocol.ArtifactSet.t()) ::
  {:ok, t()} | {:error, CharterAgreementProtocol.Error.t()}

Build a Termination signing input after R1/R2/R3 set refusal checks.