signing

package
v0.3.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 6, 2026 License: Apache-2.0 Imports: 32 Imported by: 0

Documentation

Overview

Package signing owns shared signing-operation contracts, restrictive limits, usage accounting, and bounded error vocabulary for the DKIM2 draft baseline.

Protocol field construction remains owned by instance and signature. This package deliberately contains no provider, key, route-authority, recipe, raw-message mutation, public facade, or concrete observability behavior.

Index

Constants

View Source
const (
	AlgorithmRSASHA256     = signature.AlgorithmRSASHA256
	AlgorithmEd25519SHA256 = signature.AlgorithmEd25519SHA256
	// AlgorithmMLDSA44 is the Draft-09 Section 3.4 pure ML-DSA-44 algorithm.
	AlgorithmMLDSA44 = signature.AlgorithmMLDSA44
)

Signing algorithms reuse the signature package's protocol vocabulary.

Variables

This section is empty.

Functions

func CanonicalAlgorithms

func CanonicalAlgorithms(algorithms []Algorithm) bool

CanonicalAlgorithms reports whether algorithms are one or more distinct signable algorithms in strictly increasing canonical signing order. It is the single owner of emitted signature-set order.

func EnvelopePathDomain

func EnvelopePathDomain(path []byte) (string, bool)

EnvelopePathDomain returns the canonical lowercase A-label DNS domain of one non-null SMTP path, the identity a signer selects and records for a U-label domain (Draft-09 Section 18).

func IsErrorCode

func IsErrorCode(err error, code ErrorCode) bool

IsErrorCode reports whether err contains a signing Error with code.

func NewBoundRouteEntry

func NewBoundRouteEntry(capability VerifiedRevisionInput, source routeplan.ImmutableSource, purpose routeplan.Purpose, reversePath []byte, forwardPaths [][]byte, disclosure routeplan.DisclosureClass, routeBinding []byte) (routeplan.Entry, error)

NewBoundRouteEntry derives one ordinary revision route from exact sealed capability evidence.

func NewClassifiedBoundRouteEntry

func NewClassifiedBoundRouteEntry(
	capability VerifiedRevisionInput,
	source routeplan.ImmutableSource,
	purpose routeplan.Purpose,
	reversePath []byte,
	forwardPaths [][]byte,
	disclosure routeplan.DisclosureClass,
	routeClass routeplan.RouteClass,
	routeBinding, receiverBinding []byte,
) (routeplan.Entry, error)

NewClassifiedBoundRouteEntry derives one exact classified route binding from the sealed revision capability without exposing its seal.

func NewDualReceiverClassifiedBoundRouteEntry

func NewDualReceiverClassifiedBoundRouteEntry(
	capability VerifiedRevisionInput,
	source routeplan.ImmutableSource,
	purpose routeplan.Purpose,
	reversePath []byte,
	forwardPaths [][]byte,
	disclosure routeplan.DisclosureClass,
	routeClass routeplan.RouteClass,
	routeBinding, inboundReceiverBinding, outboundReceiverBinding []byte,
) (routeplan.Entry, error)

NewDualReceiverClassifiedBoundRouteEntry derives one exact classified route binding with independently sealed inbound and outbound OOB trust edges.

func PreflightMessageInstanceField

func PreflightMessageInstanceField(number uint64, recipeBytes int, recipePresent bool, limits Limits) (int, error)

PreflightMessageInstanceField returns the exact rendered field size before allocation.

func SignableAlgorithm

func SignableAlgorithm(algorithm Algorithm) bool

SignableAlgorithm reports whether this implementation can create signatures with algorithm: rsa-sha256, ed25519-sha256, and mldsa44. The Draft-07 composite that Draft-08 removed is not implemented and fails closed.

func ValidEnvelopePath

func ValidEnvelopePath(path []byte, allowNull bool) bool

ValidEnvelopePath reports whether exact SMTP path bytes satisfy the shared signing path grammar, including RFC 6531 UTF-8 local parts and U-label domains (Draft-09 Section 18). It is the signer-owned bridge the public facade exposes to adapters.

Types

type Algorithm

type Algorithm = signature.Algorithm

Algorithm aliases the signature owner's closed signing algorithm vocabulary.

type Authorization

type Authorization struct {
	// contains filtered or unexported fields
}

Authorization is sealed single-operation evidence of one authorization.

func (Authorization) Format

func (a Authorization) Format(state fmt.State, _ rune)

Format routes every authorization formatting form through the redacted summary.

func (Authorization) GoString

func (a Authorization) GoString() string

GoString returns a constant secret-safe authorization Go representation.

func (Authorization) Matches

func (a Authorization) Matches(query AuthorizationQuery) bool

Matches reports whether evidence belongs to the exact query.

func (Authorization) Purpose

func (a Authorization) Purpose() AuthorizationPurpose

Purpose returns the closed authorization purpose.

func (Authorization) Restriction

func (a Authorization) Restriction() ForwardingRestriction

Restriction returns the closed policy or OOB result restriction.

func (Authorization) String

func (a Authorization) String() string

String returns a constant secret-safe authorization summary.

func (Authorization) Valid

func (a Authorization) Valid() bool

Valid reports whether the authorization was sealed for one exact query.

type AuthorizationFact

type AuthorizationFact struct {
	// contains filtered or unexported fields
}

AuthorizationFact records one bounded completed signing authorization stage.

func (AuthorizationFact) Format

func (f AuthorizationFact) Format(state fmt.State, _ rune)

Format routes every authorization-fact formatting form through the redacted summary.

func (AuthorizationFact) GoString

func (f AuthorizationFact) GoString() string

GoString returns the constant secret-safe authorization-fact Go representation.

func (AuthorizationFact) Purpose

Purpose returns the completed authorization stage.

func (AuthorizationFact) Restriction

func (f AuthorizationFact) Restriction() ForwardingRestriction

Restriction returns the authorization's resulting restriction.

func (AuthorizationFact) Status

Status returns the closed authorization result.

func (AuthorizationFact) String

func (f AuthorizationFact) String() string

String returns a constant secret-safe authorization-fact summary.

func (AuthorizationFact) Valid

func (f AuthorizationFact) Valid() bool

Valid reports whether the fact contains one coherent stage result.

type AuthorizationPurpose

type AuthorizationPurpose string

AuthorizationPurpose identifies one closed trusted authorization decision.

const (
	// AuthorizationPolicy lets local policy authorize bound modification facts.
	AuthorizationPolicy AuthorizationPurpose = "policy"
	// AuthorizationDisclosure permits one exact ordered multi-recipient rt set.
	AuthorizationDisclosure AuthorizationPurpose = "recipient_disclosure"
	// AuthorizationFeedbackRelay permits causally valid feedhere for one route.
	AuthorizationFeedbackRelay AuthorizationPurpose = "feedback_relay"
	// AuthorizationReceiveNextDomain permits receipt from an inherited terminal nd=.
	AuthorizationReceiveNextDomain AuthorizationPurpose = "receive_terminal_next_domain"
	// AuthorizationSendNextDomain permits one exact terminal nd= route.
	AuthorizationSendNextDomain AuthorizationPurpose = "send_terminal_next_domain"
)

func (AuthorizationPurpose) Known

func (p AuthorizationPurpose) Known() bool

Known reports whether purpose belongs to the closed authorization vocabulary.

type AuthorizationQuery

type AuthorizationQuery struct {
	// contains filtered or unexported fields
}

AuthorizationQuery is an immutable exact operation authorization request.

func NewDisclosureAuthorizationQuery

func NewDisclosureAuthorizationQuery(ticket routeplan.CopyTicket) (AuthorizationQuery, error)

NewDisclosureAuthorizationQuery binds one exact ordered multi-recipient set.

func NewFeedbackAuthorizationQuery

func NewFeedbackAuthorizationQuery(capability VerifiedRevisionInput, ticket routeplan.CopyTicket) (AuthorizationQuery, error)

NewFeedbackAuthorizationQuery binds causal feedback relay to one exact route.

func NewPolicyAuthorizationQuery

func NewPolicyAuthorizationQuery(capability VerifiedRevisionInput, ticket routeplan.CopyTicket, facts ModificationFacts) (AuthorizationQuery, error)

NewPolicyAuthorizationQuery binds bound modification facts to one exact route ticket for local policy authorization. Under Draft-09 no inherited flag restricts the result, so the query restriction is always unrestricted.

func NewReceiveNextDomainAuthorizationQuery

func NewReceiveNextDomainAuthorizationQuery(capability VerifiedRevisionInput, ticket routeplan.CopyTicket, profileDomain string) (AuthorizationQuery, error)

NewReceiveNextDomainAuthorizationQuery binds trust in one inherited terminal nd=.

func NewSendNextDomainAuthorizationQuery

func NewSendNextDomainAuthorizationQuery(capability VerifiedRevisionInput, ticket routeplan.CopyTicket, published PublishedNextDomainCapability, profileDomain, proposedNextDomain string) (AuthorizationQuery, error)

NewSendNextDomainAuthorizationQuery binds one proposed nd= and exact publication evidence.

func (AuthorizationQuery) Binding

func (q AuthorizationQuery) Binding() [sha256.Size]byte

Binding returns the opaque exact operation binding.

func (AuthorizationQuery) Format

func (q AuthorizationQuery) Format(state fmt.State, _ rune)

Format routes every query formatting form through the redacted summary.

func (AuthorizationQuery) GoString

func (q AuthorizationQuery) GoString() string

GoString returns a constant secret-safe query Go representation.

func (AuthorizationQuery) OutOfBandFacts

func (q AuthorizationQuery) OutOfBandFacts() (OutOfBandFacts, bool)

OutOfBandFacts returns detached decision-capable terminal-route facts.

func (AuthorizationQuery) PolicyFacts

PolicyFacts returns bounded modification facts and the requested restriction.

func (AuthorizationQuery) Purpose

Purpose returns the exact closed authorization purpose.

func (AuthorizationQuery) Recipients

func (q AuthorizationQuery) Recipients() [][]byte

Recipients returns exact cloned paths only across the trusted authorizer boundary.

func (AuthorizationQuery) String

func (q AuthorizationQuery) String() string

String returns a constant secret-safe query summary.

func (AuthorizationQuery) Valid

func (q AuthorizationQuery) Valid() bool

Valid reports whether the query has one exact purpose and binding.

type AuthorizationResult

type AuthorizationResult struct {
	// contains filtered or unexported fields
}

AuthorizationResult is one authorizer-returned exact-query decision.

func NewAuthorizationResult

func NewAuthorizationResult(query AuthorizationQuery, status AuthorizationStatus) AuthorizationResult

NewAuthorizationResult constructs a decision bound to one exact query.

func (AuthorizationResult) Format

func (r AuthorizationResult) Format(state fmt.State, _ rune)

Format routes every result formatting form through the redacted summary.

func (AuthorizationResult) GoString

func (r AuthorizationResult) GoString() string

GoString returns a constant secret-safe result Go representation.

func (AuthorizationResult) Status

Status returns the closed decision.

func (AuthorizationResult) String

func (r AuthorizationResult) String() string

String returns a constant secret-safe result summary.

type AuthorizationSession

type AuthorizationSession struct {
	// contains filtered or unexported fields
}

AuthorizationSession enforces one operation's separate four-call authorizer budget.

func NewAuthorizationSession

func NewAuthorizationSession(maxCalls int) (*AuthorizationSession, error)

NewAuthorizationSession constructs one bounded operation session with private entropy.

func (*AuthorizationSession) Evaluate

Evaluate validates context, call budget, typed nils, and the exact result matrix.

func (*AuthorizationSession) Format

func (s *AuthorizationSession) Format(state fmt.State, _ rune)

Format routes every session formatting form through the redacted summary.

func (*AuthorizationSession) GoString

func (s *AuthorizationSession) GoString() string

GoString returns a constant secret-safe session Go representation.

func (*AuthorizationSession) String

func (s *AuthorizationSession) String() string

String returns a constant secret-safe authorization session summary.

func (*AuthorizationSession) ValidAuthorization

func (s *AuthorizationSession) ValidAuthorization(authorization Authorization, query AuthorizationQuery) bool

ValidAuthorization authenticates exact session-issued evidence for one query.

type AuthorizationStatus

type AuthorizationStatus string

AuthorizationStatus identifies one closed authorizer decision.

const (
	// AuthorizationAuthorized reports an explicit exact-query authorization.
	AuthorizationAuthorized AuthorizationStatus = "authorized"
	// AuthorizationDenied reports an explicit exact-query denial.
	AuthorizationDenied AuthorizationStatus = "denied"
)

func (AuthorizationStatus) Known

func (s AuthorizationStatus) Known() bool

Known reports whether status belongs to the closed authorizer vocabulary.

type Authorizer

type Authorizer interface {
	Authorize(context.Context, AuthorizationQuery) (AuthorizationResult, error)
}

Authorizer decides one exact policy, disclosure, feedback, or OOB query.

type CompletedMessage

type CompletedMessage struct {
	// contains filtered or unexported fields
}

CompletedMessage is one fully proved immutable signing result.

func (CompletedMessage) Algorithms

func (m CompletedMessage) Algorithms() []Algorithm

Algorithms returns detached generated algorithms in canonical order.

func (CompletedMessage) Authorizations

func (m CompletedMessage) Authorizations() []AuthorizationFact

Authorizations returns detached bounded completed authorization facts.

func (CompletedMessage) BodyUnavailable

func (m CompletedMessage) BodyUnavailable() bool

BodyUnavailable reports whether the generated revision recipe explicitly used b:null.

func (CompletedMessage) BodyUnavailableReason

func (m CompletedMessage) BodyUnavailableReason() recipe.BodyUnavailableReason

BodyUnavailableReason returns the bounded reason only for an explicit b:null result.

func (CompletedMessage) EnvelopeForm

func (m CompletedMessage) EnvelopeForm() SignatureEnvelopeForm

EnvelopeForm returns the closed generated signature envelope form.

func (CompletedMessage) Flags

func (m CompletedMessage) Flags() []string

Flags returns detached generated flags in canonical order.

func (CompletedMessage) Format

func (m CompletedMessage) Format(state fmt.State, _ rune)

Format routes every completed-message formatting form through the redacted summary.

func (CompletedMessage) GeneratedFields

func (m CompletedMessage) GeneratedFields() [][]byte

GeneratedFields returns detached complete fields emitted by the signing coordinator in their insertion order.

func (CompletedMessage) GoString

func (m CompletedMessage) GoString() string

GoString returns the constant secret-safe completed-message Go representation.

func (CompletedMessage) Multiplicity

func (m CompletedMessage) Multiplicity() int

Multiplicity returns the sealed parent fanout copy count.

func (CompletedMessage) NewInstanceNumber

func (m CompletedMessage) NewInstanceNumber() uint64

NewInstanceNumber returns the newly emitted m= number or zero when none was emitted.

func (CompletedMessage) RecipeOutcome

func (m CompletedMessage) RecipeOutcome() recipe.GenerationOutcome

RecipeOutcome returns the closed recipe generation outcome used by the operation.

func (CompletedMessage) ReleaseOutOfBand

func (m CompletedMessage) ReleaseOutOfBand(
	ctx context.Context,
	ticket routeplan.CopyTicket,
	reversePath []byte,
	forwardPaths [][]byte,
	receiverBinding, routeScope []byte,
) ([]byte, error)

ReleaseOutOfBand atomically releases bytes to the exact sealed OOB receiver route.

func (CompletedMessage) Restriction

func (m CompletedMessage) Restriction() ForwardingRestriction

Restriction returns the strongest closed output restriction.

func (CompletedMessage) Role

func (m CompletedMessage) Role() DerivedRole

Role returns the role derived by the exact Section 12.1 hash gate.

func (CompletedMessage) Sequence

func (m CompletedMessage) Sequence() uint64

Sequence returns the newly emitted i= number.

func (CompletedMessage) SigningIdentity

func (m CompletedMessage) SigningIdentity() (domain string, timestamp uint64, err error)

SigningIdentity projects only the final locally generated signature through its owning parser, without exposing protocol parser types to public callers.

func (CompletedMessage) String

func (m CompletedMessage) String() string

String returns a constant secret-safe completed-message summary.

func (CompletedMessage) UnrestrictedBytes

func (m CompletedMessage) UnrestrictedBytes() ([]byte, bool)

UnrestrictedBytes returns a detached complete message only for unrestricted output.

func (CompletedMessage) Valid

func (m CompletedMessage) Valid() bool

Valid reports whether the completed output has one coherent closed restriction.

type CompletedSigningField

type CompletedSigningField struct {
	// contains filtered or unexported fields
}

CompletedSigningField is an internal complete field plus its sole burned route authority.

func (CompletedSigningField) Format

func (f CompletedSigningField) Format(state fmt.State, _ rune)

Format routes every completed-field formatting form through the redacted summary.

func (CompletedSigningField) GoString

func (f CompletedSigningField) GoString() string

GoString returns the constant secret-safe completed-field Go representation.

func (CompletedSigningField) String

func (f CompletedSigningField) String() string

String returns a constant secret-safe completed-field summary.

func (CompletedSigningField) Valid

func (f CompletedSigningField) Valid() bool

Valid reports whether the internal completed field retains exactly one burned reservation.

type Coordinator

type Coordinator struct {
	// contains filtered or unexported fields
}

Coordinator owns deterministic local preflight and frozen callback ordering.

func NewCoordinator

func NewCoordinator(revision RevisionVerifier, routes routeplan.Coordinator, publication *PublicationAuthority, authorizer Authorizer, signer PrivateKeySigner, limits Limits) (Coordinator, error)

NewCoordinator constructs one bounded internal field-signing coordinator.

func (Coordinator) CompleteField

CompleteField executes one already-planned internal signing operation.

func (Coordinator) CompleteMessage

func (c Coordinator) CompleteMessage(ctx context.Context, completed CompletedSigningField) (CompletedMessage, Recovery, error)

CompleteMessage inserts and independently proves the generated fields.

type Credential

type Credential struct {
	// contains filtered or unexported fields
}

Credential binds one selector, baseline algorithm, public key, and opaque private handle.

func NewCredential

func NewCredential(selector string, algorithm Algorithm, publicKey any, handle PrivateKeyHandle, limits Limits) (Credential, error)

NewCredential validates one provider-neutral signing credential. RSA keys below cryptodkim2.MinSigningRSABits fail closed with key_mismatch and the min_rsa_bits limit detail.

func (Credential) Algorithm

func (c Credential) Algorithm() Algorithm

Algorithm returns the baseline algorithm.

func (Credential) Format

func (c Credential) Format(state fmt.State, _ rune)

Format routes every credential formatting form through the redacted summary.

func (Credential) GoString

func (c Credential) GoString() string

GoString returns a constant secret-safe credential Go representation.

func (Credential) PublicKey

func (c Credential) PublicKey() any

PublicKey returns detached public verification material.

func (Credential) Selector

func (c Credential) Selector() string

Selector returns the canonical selector for trusted internal lookup.

func (Credential) String

func (c Credential) String() string

String returns a constant secret-safe credential summary.

func (Credential) Valid

func (c Credential) Valid() bool

Valid reports whether the credential is internally coherent.

type DerivedRole

type DerivedRole string

DerivedRole identifies the role selected by the exact Section 12.1 hash gate.

const (
	// RoleOriginator identifies a message without inherited DKIM2 protocol fields.
	RoleOriginator DerivedRole = "originator"
	// RoleHashUnchangedForwarder identifies an existing message whose exact SHA-256 tuple is unchanged.
	RoleHashUnchangedForwarder DerivedRole = "hash_unchanged_forwarder"
	// RoleReviser identifies an existing message whose header or body SHA-256 digest changed.
	RoleReviser DerivedRole = "reviser"
)

func (DerivedRole) Known

func (r DerivedRole) Known() bool

Known reports whether the role belongs to the closed signing vocabulary.

type EffectiveMetadata

type EffectiveMetadata struct {
	// contains filtered or unexported fields
}

EffectiveMetadata contains fixed-order derived and inherited signing flags.

func DeriveEffectiveMetadata

func DeriveEffectiveMetadata(metadata Metadata, capability VerifiedRevisionInput, ticket routeplan.CopyTicket, feedback Authorization, session *AuthorizationSession) (EffectiveMetadata, error)

DeriveEffectiveMetadata combines caller requests, route facts, and feedback authorization. Draft-09 Section 12.5 requires an intermediary that sends copies to more than one address to set exploded on the signature it creates, and forbids exploded on i=1, so originator and delivery-status signatures never carry it. exploded reports what this signer did and is therefore not inherited from earlier signatures.

func (EffectiveMetadata) Flags

func (m EffectiveMetadata) Flags() []string

Flags returns the exact fixed-order effective flags.

func (EffectiveMetadata) Format

func (m EffectiveMetadata) Format(state fmt.State, _ rune)

Format routes every metadata formatting form through the redacted summary.

func (EffectiveMetadata) GoString

func (m EffectiveMetadata) GoString() string

GoString returns a constant secret-safe derived metadata Go representation.

func (EffectiveMetadata) String

func (m EffectiveMetadata) String() string

String returns a constant secret-safe derived metadata summary.

type Error

type Error struct {
	// contains filtered or unexported fields
}

Error is a typed signing failure that never retains arbitrary causes or input.

func (*Error) Class

func (e *Error) Class() ErrorClass

Class returns the closed error class.

func (*Error) Code

func (e *Error) Code() ErrorCode

Code returns the closed error code.

func (*Error) Details

func (e *Error) Details() ErrorDetails

Details returns normalized bounded error metadata.

func (*Error) Error

func (e *Error) Error() string

Error returns a deterministic secret-safe diagnostic.

func (*Error) Format

func (e *Error) Format(state fmt.State, _ rune)

Format renders every fmt form through the secret-safe diagnostic.

func (*Error) Is

func (e *Error) Is(target error) bool

Is matches signing errors by stable code.

func (*Error) Location

func (e *Error) Location() ErrorLocation

Location returns normalized bounded coordinates.

type ErrorClass

type ErrorClass string

ErrorClass groups signing failures without exposing content.

const (
	ErrorClassOptions       ErrorClass = "options"
	ErrorClassRequest       ErrorClass = "request"
	ErrorClassProtocol      ErrorClass = "protocol"
	ErrorClassAuthorization ErrorClass = "authorization"
	ErrorClassProvider      ErrorClass = "provider"
	ErrorClassCryptographic ErrorClass = "cryptographic"
	ErrorClassLimit         ErrorClass = "limit"
	ErrorClassInvariant     ErrorClass = "invariant"
)

Signing error classes form the closed operational vocabulary.

func (ErrorClass) Known

func (c ErrorClass) Known() bool

Known reports whether class belongs to the closed signing vocabulary.

type ErrorCode

type ErrorCode string

ErrorCode identifies one closed signing contract failure.

const (
	ErrorCodeInvalidOptions           ErrorCode = "invalid_options"
	ErrorCodeInvalidRequest           ErrorCode = "invalid_request"
	ErrorCodeCapabilityMismatch       ErrorCode = "capability_mismatch"
	ErrorCodeMalformedInput           ErrorCode = "malformed_input"
	ErrorCodeProtocolTampering        ErrorCode = "protocol_tampering"
	ErrorCodeSequenceFailure          ErrorCode = "sequence_failure"
	ErrorCodeReferenceFailure         ErrorCode = "reference_failure"
	ErrorCodeHashStateAmbiguity       ErrorCode = "hash_state_ambiguity"
	ErrorCodeChainFailure             ErrorCode = "chain_failure"
	ErrorCodeAuthorizationDenied      ErrorCode = "authorization_denied"
	ErrorCodeAuthorizationUnavailable ErrorCode = "authorization_unavailable"
	ErrorCodePolicyRestriction        ErrorCode = "policy_restriction"
	ErrorCodeDisclosureDenied         ErrorCode = "disclosure_denied"
	ErrorCodeUnsupportedAlgorithm     ErrorCode = "unsupported_algorithm"
	ErrorCodeKeyMismatch              ErrorCode = "key_mismatch"
	ErrorCodeCallbackTemporary        ErrorCode = "callback_temporary"
	ErrorCodeCallbackPermanent        ErrorCode = "callback_permanent"
	ErrorCodeCryptographicSelfCheck   ErrorCode = "cryptographic_self_check_failure"
	ErrorCodeLimitExceeded            ErrorCode = "limit_exceeded"
	ErrorCodeInternalInvariant        ErrorCode = "internal_invariant_failure"
)

Signing error codes form the closed failure vocabulary.

func (ErrorCode) Known

func (c ErrorCode) Known() bool

Known reports whether code belongs to the closed signing vocabulary.

type ErrorDetails

type ErrorDetails struct {
	Class     ErrorClass
	LimitName LimitName
	Limit     int
	Actual    int
}

ErrorDetails carries bounded signing metadata only.

type ErrorLocation

type ErrorLocation struct {
	Phase     Phase
	Resource  Resource
	Algorithm Algorithm
	Sequence  uint64
	Instance  uint64
}

ErrorLocation carries bounded signing coordinates only.

type ExistingPlanRequest

type ExistingPlanRequest struct {
	Capability    VerifiedRevisionInput
	Message       rawmsg.Message
	Ticket        routeplan.CopyTicket
	BodyPolicy    recipe.BodyUnavailablePolicy
	LiteralPolicy recipe.LiteralDisclosurePolicy
}

ExistingPlanRequest carries one exact capability- and source-bound existing-message plan request.

func (ExistingPlanRequest) Format

func (r ExistingPlanRequest) Format(state fmt.State, _ rune)

Format routes every existing-message request formatting form through the redacted summary.

func (ExistingPlanRequest) GoString

func (r ExistingPlanRequest) GoString() string

GoString returns a constant secret-safe existing-message request Go representation.

func (ExistingPlanRequest) String

func (r ExistingPlanRequest) String() string

String returns a constant secret-safe existing-message request summary.

type ForwardingRestriction

type ForwardingRestriction string

ForwardingRestriction identifies the strongest closed output restriction.

const (
	// RestrictionUnrestricted permits the later ordinary release path.
	RestrictionUnrestricted ForwardingRestriction = "unrestricted"
	// RestrictionOutOfBand requires the later exact OOB acceptance release path.
	RestrictionOutOfBand ForwardingRestriction = "requires_out_of_band_acceptance"
)

func (ForwardingRestriction) Known

func (r ForwardingRestriction) Known() bool

Known reports whether restriction belongs to the closed output vocabulary.

type HashPlanCoordinator

type HashPlanCoordinator struct {
	// contains filtered or unexported fields
}

HashPlanCoordinator owns pure Section 12.1 planning dependencies.

func NewHashPlanCoordinator

func NewHashPlanCoordinator(revision RevisionVerifier, generationLimits recipe.GenerationLimits, limits Limits) (HashPlanCoordinator, error)

NewHashPlanCoordinator constructs one immutable pure hash-plan coordinator.

func (HashPlanCoordinator) Format

func (c HashPlanCoordinator) Format(state fmt.State, _ rune)

Format routes every coordinator formatting form through the redacted summary.

func (HashPlanCoordinator) GoString

func (c HashPlanCoordinator) GoString() string

GoString returns a constant secret-safe coordinator Go representation.

func (HashPlanCoordinator) PlanDeliveryStatus

PlanDeliveryStatus derives an initial DSN plan after a dedicated evidence boundary has authorized its otherwise null reverse-path envelope.

func (HashPlanCoordinator) PlanDeliveryStatusPropagation

func (c HashPlanCoordinator) PlanDeliveryStatusPropagation(ctx context.Context, request OriginatorPlanRequest) (UnsignedOperationPlan, error)

PlanDeliveryStatusPropagation derives the initial plan of a rebuilt, propagated DSN whose authority is the removed completion signature. It is purpose-separated from ordinary DSN signing so that neither route ticket can authorize the other operation.

func (HashPlanCoordinator) PlanExisting

PlanExisting derives forwarding or revision solely from the exact SHA-256 tuple.

func (HashPlanCoordinator) PlanNextDomain

PlanNextDomain derives the same exact hash gate for one terminal next-domain operation.

func (HashPlanCoordinator) PlanOriginator

PlanOriginator derives the sole legal origin plan without invoking external services.

func (HashPlanCoordinator) String

func (c HashPlanCoordinator) String() string

String returns a constant secret-safe coordinator summary.

type HashTuple

type HashTuple struct {
	// contains filtered or unexported fields
}

HashTuple stores one immutable exact SHA-256 header/body digest pair.

func (HashTuple) Body

func (h HashTuple) Body() [sha256.Size]byte

Body returns the exact body digest.

func (HashTuple) Format

func (h HashTuple) Format(state fmt.State, _ rune)

Format routes every tuple formatting form through the redacted summary.

func (HashTuple) GoString

func (h HashTuple) GoString() string

GoString returns a constant secret-safe tuple Go representation.

func (HashTuple) Header

func (h HashTuple) Header() [sha256.Size]byte

Header returns the exact header digest.

func (HashTuple) String

func (h HashTuple) String() string

String returns a constant secret-safe tuple summary.

func (HashTuple) Valid

func (h HashTuple) Valid() bool

Valid reports whether the tuple was derived from canonical SHA-256 results.

type LimitName

type LimitName string

LimitName identifies one closed signing limit or coherence rule.

const (
	LimitNameMaxMessageBytes                 LimitName = "max_message_bytes"
	LimitNameMaxHeaderBytes                  LimitName = "max_header_bytes"
	LimitNameMaxHeaderFields                 LimitName = "max_header_fields"
	LimitNameMaxFieldBytes                   LimitName = "max_field_bytes"
	LimitNameMaxLineBytes                    LimitName = "max_line_bytes"
	LimitNameMaxInstances                    LimitName = "max_instances"
	LimitNameMaxSignatures                   LimitName = "max_signatures"
	LimitNameMaxProtocolFields               LimitName = "max_protocol_fields"
	LimitNameMaxHashSetsPerInstance          LimitName = "max_hash_sets_per_instance"
	LimitNameMaxSignatureSetsPerField        LimitName = "max_signature_sets_per_field"
	LimitNameMaxTotalSignatureSets           LimitName = "max_total_signature_sets"
	LimitNameMaxPublicKeyLookups             LimitName = "max_public_key_lookups"
	LimitNameMaxSignatureInputBytes          LimitName = "max_signature_input_bytes"
	LimitNameMaxCanonicalWorkBytes           LimitName = "max_canonical_work_bytes"
	LimitNameMaxGeneratedRecipients          LimitName = "max_generated_recipients"
	LimitNameMaxParentOutputCopiesAndTickets LimitName = "max_parent_output_copies_and_tickets"
	LimitNameMaxEnvelopePathBytes            LimitName = "max_envelope_path_bytes"
	LimitNameMaxDecodedRecipeBytes           LimitName = "max_decoded_recipe_bytes"
	LimitNameMaxGeneratedSignatureSets       LimitName = "max_generated_signature_sets"
	LimitNameMaxAuthorizationCalls           LimitName = "max_authorization_calls"
	LimitNameMaxPrivateSigningCalls          LimitName = "max_private_signing_calls"
	LimitNameMaxNonceBytes                   LimitName = "max_nonce_bytes"
	LimitNameMinRSABits                      LimitName = "min_rsa_bits"
	LimitNameMaxRSABits                      LimitName = "max_rsa_bits"
	LimitNameMaxPrivateSignatureBytes        LimitName = "max_private_signature_bytes"
	LimitNameMaxNewInstances                 LimitName = "max_new_instances"
	LimitNameRequiredNewSignatures           LimitName = "required_new_signatures"
	LimitNameExactCryptographicContract      LimitName = "exact_cryptographic_contract"
	LimitNameLimitCoherence                  LimitName = "limit_coherence"
	LimitNameRecipeFieldCoherence            LimitName = "recipe_field_coherence"
)

Signing limit names form the closed resource vocabulary.

func (LimitName) Known

func (n LimitName) Known() bool

Known reports whether name belongs to the closed signing limit vocabulary.

type Limits

type Limits struct {
	MaxMessageBytes                 int
	MaxHeaderBytes                  int
	MaxHeaderFields                 int
	MaxFieldBytes                   int
	MaxLineBytes                    int
	MaxInstances                    int
	MaxSignatures                   int
	MaxProtocolFields               int
	MaxHashSetsPerInstance          int
	MaxSignatureSetsPerField        int
	MaxTotalSignatureSets           int
	MaxPublicKeyLookups             int
	MaxSignatureInputBytes          int
	MaxCanonicalWorkBytes           int
	MaxGeneratedRecipients          int
	MaxParentOutputCopiesAndTickets int
	MaxEnvelopePathBytes            int
	MaxDecodedRecipeBytes           int
	MaxGeneratedSignatureSets       int
	MaxAuthorizationCalls           int
	MaxPrivateSigningCalls          int
	MaxNonceBytes                   int
	MinRSABits                      int
	MaxRSABits                      int
	RequiredRSAExponent             int
	MaxPrivateSignatureBytes        int
	Ed25519PublicKeyBytes           int
	Ed25519SignatureBytes           int
	MaxNewInstances                 int
	RequiredNewSignatures           int
}

Limits contains the signing increment's hard and narrowable ceilings.

func DefaultLimits

func DefaultLimits() Limits

DefaultLimits returns the exact durable signing hard ceilings.

func (Limits) Validate

func (l Limits) Validate() error

Validate rejects widening, negative, exact-value, and coherence violations.

type Metadata

type Metadata struct {
	// contains filtered or unexported fields
}

Metadata contains an optional nonce and caller-requestable baseline flags.

func NewSigningMetadata

func NewSigningMetadata(nonce []byte, noncePresent bool, requested []string) (Metadata, error)

NewSigningMetadata validates immutable nonce presence and caller-requestable flags. Only feedback is requestable: Draft-07 Section 10.10 removed donotmodify and donotexplode, so requesting them fails closed.

func (Metadata) Format

func (m Metadata) Format(state fmt.State, _ rune)

Format routes every metadata formatting form through the redacted summary.

func (Metadata) GoString

func (m Metadata) GoString() string

GoString returns a constant secret-safe metadata Go representation.

func (Metadata) Nonce

func (m Metadata) Nonce() ([]byte, bool)

Nonce returns exact detached nonce bytes and explicit presence.

func (Metadata) RequestedFlags

func (m Metadata) RequestedFlags() []string

RequestedFlags returns detached caller-requested flags.

func (Metadata) String

func (m Metadata) String() string

String returns a constant secret-safe metadata summary.

func (Metadata) Valid

func (m Metadata) Valid() bool

Valid reports whether metadata satisfies the closed caller-owned contract.

type ModificationFacts

type ModificationFacts struct {
	// contains filtered or unexported fields
}

ModificationFacts records invariant-owned bounded policy facts without message content.

func (ModificationFacts) BodyChanged

func (f ModificationFacts) BodyChanged() bool

BodyChanged reports whether the verified prior body differs from the proposed body.

func (ModificationFacts) ExistingHeadersChanged

func (f ModificationFacts) ExistingHeadersChanged() bool

ExistingHeadersChanged reports whether any prior header was removed, changed, or reordered.

func (ModificationFacts) Format

func (f ModificationFacts) Format(state fmt.State, _ rune)

Format routes every modification-facts formatting form through the redacted summary.

func (ModificationFacts) GoString

func (f ModificationFacts) GoString() string

GoString returns a constant secret-safe modification Go representation.

func (ModificationFacts) String

func (f ModificationFacts) String() string

String returns a constant secret-safe modification summary.

type OriginatorPlanRequest

type OriginatorPlanRequest struct {
	Message rawmsg.Message
	Ticket  routeplan.CopyTicket
	Instant verify.RevisionInstant
}

OriginatorPlanRequest carries one exact source-bound origin plan request. Instant optionally binds the plan to an already captured operation instant so that a report rendered at that instant carries the same t= it is signed with; the zero value captures a fresh instant, and a supplied instant is accepted only from the coordinator's own verifier and within its skew tolerance around a fresh capture.

func (OriginatorPlanRequest) Format

func (r OriginatorPlanRequest) Format(state fmt.State, _ rune)

Format routes every originator request formatting form through the redacted summary.

func (OriginatorPlanRequest) GoString

func (r OriginatorPlanRequest) GoString() string

GoString returns a constant secret-safe originator request Go representation.

func (OriginatorPlanRequest) String

func (r OriginatorPlanRequest) String() string

String returns a constant secret-safe originator request summary.

type OutOfBandFacts

type OutOfBandFacts struct {
	// contains filtered or unexported fields
}

OutOfBandFacts stores exact terminal-route authorization evidence.

func (OutOfBandFacts) Format

func (f OutOfBandFacts) Format(state fmt.State, _ rune)

Format routes every OOB facts formatting form through the redacted summary.

func (OutOfBandFacts) ForwardPaths

func (f OutOfBandFacts) ForwardPaths() [][]byte

ForwardPaths returns detached exact intended forward-paths.

func (OutOfBandFacts) GoString

func (f OutOfBandFacts) GoString() string

GoString returns a constant secret-safe OOB facts Go representation.

func (OutOfBandFacts) PredecessorDomain

func (f OutOfBandFacts) PredecessorDomain() string

PredecessorDomain returns the authenticated predecessor domain.

func (OutOfBandFacts) PredecessorKind

func (f OutOfBandFacts) PredecessorKind() PredecessorKind

PredecessorKind returns the authenticated predecessor envelope form.

func (OutOfBandFacts) ProfileDomain

func (f OutOfBandFacts) ProfileDomain() string

ProfileDomain returns the canonical proposed signer domain.

func (OutOfBandFacts) ProposedNextDomain

func (f OutOfBandFacts) ProposedNextDomain() string

ProposedNextDomain returns the future nd= or empty for receive authorization.

func (OutOfBandFacts) ReceiverBinding

func (f OutOfBandFacts) ReceiverBinding() []byte

ReceiverBinding returns the detached exact receiver-transaction binding.

func (OutOfBandFacts) ReversePath

func (f OutOfBandFacts) ReversePath() []byte

ReversePath returns the detached exact intended reverse-path.

func (OutOfBandFacts) Route

func (f OutOfBandFacts) Route() []byte

Route returns the detached exact trusted route-scope handle.

func (OutOfBandFacts) RouteScope

func (f OutOfBandFacts) RouteScope() [sha256.Size]byte

RouteScope returns the opaque exact route binding.

func (OutOfBandFacts) String

func (f OutOfBandFacts) String() string

String returns a constant secret-safe OOB facts summary.

func (OutOfBandFacts) Valid

func (f OutOfBandFacts) Valid() bool

Valid reports whether facts are complete and locally coherent.

type Phase

type Phase string

Phase identifies one bounded signing operation phase.

const (
	PhaseOptions   Phase = "options"
	PhasePreflight Phase = "preflight"
	PhaseSequence  Phase = "sequence"
	PhaseRender    Phase = "render"
	PhaseCallback  Phase = "callback"
	PhaseComplete  Phase = "complete"
)

Signing phases form the closed operation-stage vocabulary.

func (Phase) Known

func (p Phase) Known() bool

Known reports whether phase belongs to the closed signing vocabulary.

type PlanGenerationFacts

type PlanGenerationFacts struct {
	// contains filtered or unexported fields
}

PlanGenerationFacts records the bounded inverse-recipe result used by a plan.

func (PlanGenerationFacts) ApplyUsage

func (f PlanGenerationFacts) ApplyUsage() recipe.Usage

ApplyUsage returns the strict independent recipe-application proof accounting.

func (PlanGenerationFacts) BodyOutcome

BodyOutcome returns the closed body-generation outcome.

func (PlanGenerationFacts) BodyUnavailablePolicy

func (f PlanGenerationFacts) BodyUnavailablePolicy() recipe.BodyUnavailablePolicy

BodyUnavailablePolicy returns the closed recipe body-unavailable policy.

func (PlanGenerationFacts) BodyUnavailableReason

func (f PlanGenerationFacts) BodyUnavailableReason() recipe.BodyUnavailableReason

BodyUnavailableReason returns the explicit unavailable-body reason when present.

func (PlanGenerationFacts) CanonicalWorkBytes

func (f PlanGenerationFacts) CanonicalWorkBytes() int

CanonicalWorkBytes returns aggregate sealed and local canonical hash work.

func (PlanGenerationFacts) CurrentHashCanonicalWorkBytes

func (f PlanGenerationFacts) CurrentHashCanonicalWorkBytes() int

CurrentHashCanonicalWorkBytes returns exact final header/body hash work reserved for completion.

func (PlanGenerationFacts) DecodedBytes

func (f PlanGenerationFacts) DecodedBytes() int

DecodedBytes returns the exact decoded JSON byte count.

func (PlanGenerationFacts) Format

func (f PlanGenerationFacts) Format(state fmt.State, _ rune)

Format routes every generation-facts formatting form through the redacted summary.

func (PlanGenerationFacts) GoString

func (f PlanGenerationFacts) GoString() string

GoString returns a constant secret-safe generation Go representation.

func (PlanGenerationFacts) LiteralPolicy

LiteralPolicy returns the closed recipe literal-disclosure policy.

func (PlanGenerationFacts) Outcome

Outcome returns the closed recipe-generation outcome.

func (PlanGenerationFacts) ParseUsage

func (f PlanGenerationFacts) ParseUsage() recipe.Usage

ParseUsage returns the strict independent recipe-parse proof accounting.

func (PlanGenerationFacts) String

func (f PlanGenerationFacts) String() string

String returns a constant secret-safe generation summary.

func (PlanGenerationFacts) Usage

Usage returns immutable recipe-generation accounting.

func (PlanGenerationFacts) Valid

func (f PlanGenerationFacts) Valid() bool

Valid reports whether recipe outcome, policy, proof usage, and canonical work agree.

type PlanSizeFacts

type PlanSizeFacts struct {
	// contains filtered or unexported fields
}

PlanSizeFacts stores exact known sizes and reserved protocol cardinality.

func (PlanSizeFacts) FinalHeaderFields

func (f PlanSizeFacts) FinalHeaderFields() int

FinalHeaderFields returns the exact raw header occurrence count after insertion.

func (PlanSizeFacts) HeaderBytes

func (f PlanSizeFacts) HeaderBytes() int

HeaderBytes returns the worst-case complete header bytes after both planned field insertions.

func (PlanSizeFacts) InstanceFieldBytes

func (f PlanSizeFacts) InstanceFieldBytes() int

InstanceFieldBytes returns the exact new Message-Instance field size.

func (PlanSizeFacts) MessageBytes

func (f PlanSizeFacts) MessageBytes() int

MessageBytes returns the worst-case complete message bytes after both planned field insertions.

func (PlanSizeFacts) ProtocolFields

func (f PlanSizeFacts) ProtocolFields() int

ProtocolFields returns the count after reserving the required future signature.

func (PlanSizeFacts) SignatureFieldAllowanceBytes

func (f PlanSizeFacts) SignatureFieldAllowanceBytes() int

SignatureFieldAllowanceBytes returns the exact bounded allowance remaining for the future field.

func (PlanSizeFacts) SignatureFieldLimitName

func (f PlanSizeFacts) SignatureFieldLimitName() LimitName

SignatureFieldLimitName returns the dimension that bounded the future field allowance.

func (PlanSizeFacts) SignatureFields

func (f PlanSizeFacts) SignatureFields() int

SignatureFields returns the count after reserving the required future signature.

func (PlanSizeFacts) Valid

func (f PlanSizeFacts) Valid() bool

Valid reports whether all exact sizes and reserved counts are initialized.

type PredecessorKind

type PredecessorKind string

PredecessorKind identifies the authenticated predecessor envelope form.

const (
	// PredecessorOrdinary identifies an ordinary predecessor recipient domain.
	PredecessorOrdinary PredecessorKind = "ordinary"
	// PredecessorNextDomain identifies an inherited terminal nd= domain.
	PredecessorNextDomain PredecessorKind = "next_domain"
)

func (PredecessorKind) Known

func (k PredecessorKind) Known() bool

Known reports whether kind belongs to the closed predecessor vocabulary.

type PreparedRevisionRevalidation

type PreparedRevisionRevalidation struct {
	// contains filtered or unexported fields
}

PreparedRevisionRevalidation is one opaque provider-free capability revalidation plan.

func (PreparedRevisionRevalidation) Format

func (p PreparedRevisionRevalidation) Format(state fmt.State, _ rune)

Format routes every prepared revalidation formatting form through the redacted summary.

func (PreparedRevisionRevalidation) GoString

func (p PreparedRevisionRevalidation) GoString() string

GoString returns the constant secret-safe prepared revalidation Go representation.

func (PreparedRevisionRevalidation) String

String returns a constant secret-safe prepared revalidation summary.

func (PreparedRevisionRevalidation) Usage

Usage returns exact repeated inherited proof work and fixed callback counts.

func (PreparedRevisionRevalidation) Valid

Valid reports whether the prepared capability plan is initialized.

type PrivateKeyHandle

type PrivateKeyHandle struct {
	// contains filtered or unexported fields
}

PrivateKeyHandle is an opaque immutable provider reference with no key accessor.

func NewPrivateKeyHandle

func NewPrivateKeyHandle(identity []byte) (PrivateKeyHandle, error)

NewPrivateKeyHandle constructs one opaque handle from provider-owned identity bytes.

func (PrivateKeyHandle) Format

func (h PrivateKeyHandle) Format(state fmt.State, _ rune)

Format routes every handle formatting form through the redacted summary.

func (PrivateKeyHandle) GoString

func (h PrivateKeyHandle) GoString() string

GoString returns a constant secret-safe handle Go representation.

func (PrivateKeyHandle) String

func (h PrivateKeyHandle) String() string

String returns a constant secret-safe handle summary.

func (PrivateKeyHandle) Valid

func (h PrivateKeyHandle) Valid() bool

Valid reports whether the handle was constructed from nonempty identity.

type PrivateKeySignRequest

type PrivateKeySignRequest struct {
	// contains filtered or unexported fields
}

PrivateKeySignRequest carries only the closed algorithm and the message representative of the Section 12.8 signature input that algorithm signs: the SHA-256 digest for rsa-sha256 and ed25519-sha256, and the complete input bytes for pure mldsa44 (cryptodkim2.MessageRepresentative).

func NewPrivateKeySignRequest

func NewPrivateKeySignRequest(algorithm Algorithm, representative []byte) (PrivateKeySignRequest, error)

NewPrivateKeySignRequest constructs one immutable request and requires a representative length coherent with the algorithm.

func (PrivateKeySignRequest) Algorithm

func (r PrivateKeySignRequest) Algorithm() Algorithm

Algorithm returns the requested signature algorithm.

func (PrivateKeySignRequest) Format

func (r PrivateKeySignRequest) Format(state fmt.State, _ rune)

Format routes every private request formatting form through the redacted summary.

func (PrivateKeySignRequest) GoString

func (r PrivateKeySignRequest) GoString() string

GoString returns the constant secret-safe private request Go representation.

func (PrivateKeySignRequest) MessageRepresentative

func (r PrivateKeySignRequest) MessageRepresentative() []byte

MessageRepresentative returns a copy of the exact bytes the algorithm's signing primitive consumes.

func (PrivateKeySignRequest) String

func (r PrivateKeySignRequest) String() string

String returns a constant secret-safe private request summary.

func (PrivateKeySignRequest) Valid

func (r PrivateKeySignRequest) Valid() bool

Valid reports whether the request was constructed for one closed algorithm.

type PrivateKeySignResult

type PrivateKeySignResult struct {
	// contains filtered or unexported fields
}

PrivateKeySignResult owns detached signature bytes from one successful callback.

func NewPrivateKeySignResult

func NewPrivateKeySignResult(signatureBytes []byte) PrivateKeySignResult

NewPrivateKeySignResult constructs a detached successful callback result.

func (PrivateKeySignResult) Format

func (r PrivateKeySignResult) Format(state fmt.State, _ rune)

Format routes every private result formatting form through the redacted summary.

func (PrivateKeySignResult) GoString

func (r PrivateKeySignResult) GoString() string

GoString returns the constant secret-safe private result Go representation.

func (PrivateKeySignResult) String

func (r PrivateKeySignResult) String() string

String returns a constant secret-safe private result summary.

type PrivateKeySignStatus

type PrivateKeySignStatus string

PrivateKeySignStatus identifies the sole successful private-signing outcome.

const (
	// PrivateKeySigned reports one completed signature byte string.
	PrivateKeySigned PrivateKeySignStatus = "signed"
)

type PrivateKeySigner

type PrivateKeySigner interface {
	SignDigest(context.Context, PrivateKeyHandle, PrivateKeySignRequest) (PrivateKeySignResult, error)
}

PrivateKeySigner signs one message representative through an opaque key handle. The method keeps its historical name; for mldsa44 the representative is the complete Section 12.8 input, not a digest.

type Profile

type Profile struct {
	// contains filtered or unexported fields
}

Profile contains one canonical domain and up to one credential per signable algorithm in canonical signing order.

func NewProfile

func NewProfile(domain string, credentials []Credential) (Profile, error)

NewProfile validates domain, unique algorithms/selectors, and canonical credential order.

func (Profile) Credentials

func (p Profile) Credentials() []Credential

Credentials returns detached credentials in canonical signing order: RSA, Ed25519, then ML-DSA-44.

func (Profile) Domain

func (p Profile) Domain() string

Domain returns the canonical signing domain.

func (Profile) Format

func (p Profile) Format(state fmt.State, _ rune)

Format routes every profile formatting form through the redacted summary.

func (Profile) GoString

func (p Profile) GoString() string

GoString returns a constant secret-safe profile Go representation.

func (Profile) String

func (p Profile) String() string

String returns a constant secret-safe profile summary.

func (Profile) Valid

func (p Profile) Valid() bool

Valid reports whether the profile remains canonical and coherent.

func (Profile) ValidForLimits

func (p Profile) ValidForLimits(limits Limits) bool

ValidForLimits reports whether every credential satisfies one narrowed operation contract.

type PublicationAuthority

type PublicationAuthority struct {
	// contains filtered or unexported fields
}

PublicationAuthority validates current profile publication and issues future-domain capabilities.

func NewPublicationAuthority

func NewPublicationAuthority(keyProvider verify.KeyProvider, clock func() time.Time, freshness time.Duration) (*PublicationAuthority, error)

NewPublicationAuthority constructs one publication issuer with private entropy.

func (*PublicationAuthority) ConsumeAndRevalidate

func (a *PublicationAuthority) ConsumeAndRevalidate(ctx context.Context, capability PublishedNextDomainCapability) error

ConsumeAndRevalidate atomically consumes and freshly revalidates the exact supplied capability.

func (*PublicationAuthority) ConsumeAndRevalidateAt

func (a *PublicationAuthority) ConsumeAndRevalidateAt(ctx context.Context, capability PublishedNextDomainCapability, now time.Time) error

ConsumeAndRevalidateAt atomically consumes and revalidates at the plan-owned instant.

func (*PublicationAuthority) Format

func (a *PublicationAuthority) Format(state fmt.State, _ rune)

Format routes every authority formatting form through the redacted summary.

func (*PublicationAuthority) GoString

func (a *PublicationAuthority) GoString() string

GoString returns a constant secret-safe authority Go representation.

func (*PublicationAuthority) IssueNextDomain

func (a *PublicationAuthority) IssueNextDomain(ctx context.Context, domain string, credential Credential) (PublishedNextDomainCapability, error)

IssueNextDomain performs a fresh authoritative lookup and seals exact future evidence.

func (*PublicationAuthority) String

func (a *PublicationAuthority) String() string

String returns a constant secret-safe publication authority summary.

func (*PublicationAuthority) Valid

func (a *PublicationAuthority) Valid() bool

Valid reports whether the authority owns coherent immutable dependencies and bounded state.

func (*PublicationAuthority) ValidateNextDomainCapabilityAt

func (a *PublicationAuthority) ValidateNextDomainCapabilityAt(capability PublishedNextDomainCapability, now time.Time) error

ValidateNextDomainCapabilityAt performs pure local seal, freshness, and reuse checks.

func (*PublicationAuthority) ValidateProfilePublication

func (a *PublicationAuthority) ValidateProfilePublication(ctx context.Context, profile Profile) error

ValidateProfilePublication proves every generated credential through the provider.

type PublishedNextDomainCapability

type PublishedNextDomainCapability struct {
	// contains filtered or unexported fields
}

PublishedNextDomainCapability is single-use fresh evidence for one exact future credential.

func (PublishedNextDomainCapability) Format

func (c PublishedNextDomainCapability) Format(state fmt.State, _ rune)

Format routes every capability formatting form through the redacted summary.

func (PublishedNextDomainCapability) GoString

GoString returns a constant secret-safe capability Go representation.

func (PublishedNextDomainCapability) String

String returns a constant secret-safe capability summary.

func (PublishedNextDomainCapability) Valid

Valid reports whether the capability has complete immutable publication evidence.

type Recovery

type Recovery struct {
	// contains filtered or unexported fields
}

Recovery carries only route lineage recovery and never partial signature state.

func (Recovery) Format

func (r Recovery) Format(state fmt.State, _ rune)

Format routes every recovery formatting form through the redacted summary.

func (Recovery) GoString

func (r Recovery) GoString() string

GoString returns the constant secret-safe recovery Go representation.

func (*Recovery) Recover

func (r *Recovery) Recover(ctx context.Context) (routeplan.CopyTicket, error)

Recover resumes pending authority cleanup or yields the already issued replacement.

func (Recovery) RecoveryPending

func (r Recovery) RecoveryPending() bool

RecoveryPending reports whether route authority recovery must be retried.

func (Recovery) ReplacementReady

func (r Recovery) ReplacementReady() bool

ReplacementReady reports whether Recover will consume an already issued replacement.

func (Recovery) String

func (r Recovery) String() string

String returns a constant secret-safe recovery summary.

func (Recovery) Valid

func (r Recovery) Valid() bool

Valid reports whether recovery owns either one replacement or one retryable transition.

type Resource

type Resource string

Resource identifies one bounded signing usage dimension.

const (
	ResourceMessageBytes                 Resource = "message_bytes"
	ResourceHeaderBytes                  Resource = "header_bytes"
	ResourceHeaderFields                 Resource = "header_fields"
	ResourceProtocolFields               Resource = "protocol_fields"
	ResourceSignatureSets                Resource = "signature_sets"
	ResourcePublicKeyLookups             Resource = "public_key_lookups"
	ResourceSignatureInputBytes          Resource = "signature_input_bytes"
	ResourceCanonicalWorkBytes           Resource = "canonical_work_bytes"
	ResourceGeneratedRecipients          Resource = "generated_recipients"
	ResourceParentOutputCopiesAndTickets Resource = "parent_output_copies_and_tickets"
	ResourceEnvelopePathBytes            Resource = "envelope_path_bytes"
	ResourceDecodedRecipeBytes           Resource = "decoded_recipe_bytes"
	ResourceGeneratedSignatureSets       Resource = "generated_signature_sets"
	ResourceAuthorizationCalls           Resource = "authorization_calls"
	ResourcePrivateSigningCalls          Resource = "private_signing_calls"
	ResourceNonceBytes                   Resource = "nonce_bytes"
	ResourceNewInstances                 Resource = "new_instances"
	ResourceNewSignatures                Resource = "new_signatures"
)

Signing resources form the closed cumulative-usage vocabulary.

func (Resource) Known

func (r Resource) Known() bool

Known reports whether resource belongs to the closed usage vocabulary.

type RevisionRequest

type RevisionRequest struct {
	Message  rawmsg.Message
	Envelope verify.Envelope
}

RevisionRequest carries exact immutable inbound evidence for dedicated revision verification.

func (RevisionRequest) Format

func (r RevisionRequest) Format(state fmt.State, _ rune)

Format routes every request formatting form through the redacted summary.

func (RevisionRequest) GoString

func (r RevisionRequest) GoString() string

GoString returns a constant secret-safe request Go representation.

func (RevisionRequest) String

func (r RevisionRequest) String() string

String returns a constant secret-safe request summary.

type RevisionVerification

type RevisionVerification struct {
	// contains filtered or unexported fields
}

RevisionVerification stores one initialized closed outcome without message content.

func (RevisionVerification) Format

func (r RevisionVerification) Format(state fmt.State, _ rune)

Format routes every outcome formatting form through the redacted summary.

func (RevisionVerification) GoString

func (r RevisionVerification) GoString() string

GoString returns a constant secret-safe outcome Go representation.

func (RevisionVerification) Status

Status returns the closed status or zero for an invalid outcome.

func (RevisionVerification) String

func (r RevisionVerification) String() string

String returns a constant secret-safe outcome summary.

func (RevisionVerification) Valid

func (r RevisionVerification) Valid() bool

Valid reports whether the outcome was constructed by VerifyForRevision.

type RevisionVerificationStatus

type RevisionVerificationStatus string

RevisionVerificationStatus identifies the closed dedicated revision outcome.

const (
	// RevisionVerificationVerified reports complete ordinary all-hop proof.
	RevisionVerificationVerified RevisionVerificationStatus = "verified"
	// RevisionVerificationTerminalNextDomainAuthorizationRequired reports clean proof ending in terminal nd=.
	RevisionVerificationTerminalNextDomainAuthorizationRequired RevisionVerificationStatus = "terminal_next_domain_authorization_required"
	// RevisionVerificationProtocolRejected reports rejected inherited protocol evidence.
	RevisionVerificationProtocolRejected RevisionVerificationStatus = "protocol_rejected"
	// RevisionVerificationUnsupported reports unsupported-only inherited evidence.
	RevisionVerificationUnsupported RevisionVerificationStatus = "unsupported"
	// RevisionVerificationProviderTemporary reports retryable key-provider failure.
	RevisionVerificationProviderTemporary RevisionVerificationStatus = "provider_temporary"
	// RevisionVerificationProviderRejected reports permanent key-provider rejection.
	RevisionVerificationProviderRejected RevisionVerificationStatus = "provider_rejected"
	// RevisionVerificationProviderContract reports an inconsistent provider contract.
	RevisionVerificationProviderContract RevisionVerificationStatus = "provider_contract"
	// RevisionVerificationLimitExceeded reports bounded verification work exhaustion.
	RevisionVerificationLimitExceeded RevisionVerificationStatus = "limit_exceeded"
)

func (RevisionVerificationStatus) Known

func (s RevisionVerificationStatus) Known() bool

Known reports whether status belongs to the closed dedicated revision vocabulary.

type RevisionVerifier

type RevisionVerifier struct {
	// contains filtered or unexported fields
}

RevisionVerifier owns dedicated proof orchestration and one immutable sealing key.

func NewRevisionVerifier

func NewRevisionVerifier(verifier verify.Verifier, limits Limits) (RevisionVerifier, error)

NewRevisionVerifier constructs a dedicated revision verifier with a fresh per-instance seal key.

func (RevisionVerifier) CaptureOperationInstant

func (v RevisionVerifier) CaptureOperationInstant() (verify.RevisionInstant, error)

CaptureOperationInstant captures the sole verifier-owned time for one signing operation.

func (RevisionVerifier) ConsumeVerifiedRevisionInput

func (v RevisionVerifier) ConsumeVerifiedRevisionInput(ctx context.Context, capability VerifiedRevisionInput, revised rawmsg.Message) error

ConsumeVerifiedRevisionInput validates the capability at one newly captured instant.

func (RevisionVerifier) ConsumeVerifiedRevisionInputAt

func (v RevisionVerifier) ConsumeVerifiedRevisionInputAt(ctx context.Context, capability VerifiedRevisionInput, revised rawmsg.Message, instant verify.RevisionInstant) error

ConsumeVerifiedRevisionInputAt validates exact capability state at one operation instant.

func (RevisionVerifier) Core

func (v RevisionVerifier) Core() verify.Verifier

Core returns the validated protocol-core verifier so that facades built on the same provider, limits, and clock can reuse it for evaluations the revision verifier does not own, such as received-DSN evaluation and rebuild.

func (RevisionVerifier) EvaluateDeliveryStatus

func (v RevisionVerifier) EvaluateDeliveryStatus(
	ctx context.Context,
	report dsn.Report,
) (dsn.Evidence, error)

EvaluateDeliveryStatus verifies one parsed DSN embedded original through the dedicated DSN evidence path. It never issues a revision capability.

func (RevisionVerifier) EvaluatePostfixDeliveryStatus

func (v RevisionVerifier) EvaluatePostfixDeliveryStatus(
	ctx context.Context,
	report dsn.Report,
) (dsn.Evidence, error)

EvaluatePostfixDeliveryStatus verifies one trusted-Postfix DSN while admitting only the current bounce(8) wire profile's bounded order and folding.

func (RevisionVerifier) ExecuteRevalidationForSigning

func (v RevisionVerifier) ExecuteRevalidationForSigning(ctx context.Context, prepared PreparedRevisionRevalidation) error

ExecuteRevalidationForSigning performs only inherited provider lookup and crypto work.

func (RevisionVerifier) Format

func (v RevisionVerifier) Format(state fmt.State, _ rune)

Format routes every verifier formatting form through the redacted summary.

func (RevisionVerifier) GoString

func (v RevisionVerifier) GoString() string

GoString returns a constant secret-safe verifier Go representation.

func (RevisionVerifier) PrepareRevalidationForSigningAt

func (v RevisionVerifier) PrepareRevalidationForSigningAt(ctx context.Context, capability VerifiedRevisionInput, instant verify.RevisionInstant) (PreparedRevisionRevalidation, error)

PrepareRevalidationForSigningAt completes all local inherited-proof work before authority reservation.

func (RevisionVerifier) RevalidateForSigningAt

func (v RevisionVerifier) RevalidateForSigningAt(ctx context.Context, capability VerifiedRevisionInput, instant verify.RevisionInstant) error

RevalidateForSigningAt repeats full inherited proof and exact capability binding at one instant.

func (RevisionVerifier) String

func (v RevisionVerifier) String() string

String returns a constant secret-safe verifier summary.

func (RevisionVerifier) VerifyForRevision

VerifyForRevision verifies all inherited proof and seals exact cloned input only for clean states.

type SignFieldRequest

type SignFieldRequest struct {
	Plan         UnsignedOperationPlan
	Capability   VerifiedRevisionInput
	Message      rawmsg.Message
	Ticket       routeplan.CopyTicket
	ReversePath  []byte
	ForwardPaths [][]byte
	Profile      Profile
	Metadata     Metadata
	Transport    rawmsg.TransportForm
	EnvelopeForm SignatureEnvelopeForm
	NextDomain   string
	Published    PublishedNextDomainCapability
}

SignFieldRequest binds one plan to exact source, route, profile, and metadata.

func (SignFieldRequest) Format

func (r SignFieldRequest) Format(state fmt.State, _ rune)

Format routes every field request formatting form through the redacted summary.

func (SignFieldRequest) GoString

func (r SignFieldRequest) GoString() string

GoString returns the constant secret-safe field request Go representation.

func (SignFieldRequest) String

func (r SignFieldRequest) String() string

String returns a constant secret-safe field request summary.

type SignatureEnvelopeForm

type SignatureEnvelopeForm string

SignatureEnvelopeForm identifies one closed generated signature envelope shape.

const (
	// SignatureEnvelopeOrdinary identifies the required mf= plus rt= form.
	SignatureEnvelopeOrdinary SignatureEnvelopeForm = "ordinary_mf_rt"
	// SignatureEnvelopeNextDomain identifies the terminal nd= form.
	SignatureEnvelopeNextDomain SignatureEnvelopeForm = "next_domain"
)

func (SignatureEnvelopeForm) Known

func (f SignatureEnvelopeForm) Known() bool

Known reports whether the envelope form belongs to this signing contract.

type UnsignedOperationPlan

type UnsignedOperationPlan struct {
	// contains filtered or unexported fields
}

UnsignedOperationPlan is an immutable pure hash-gate and instance plan.

func (UnsignedOperationPlan) CurrentHashes

func (p UnsignedOperationPlan) CurrentHashes() HashTuple

CurrentHashes returns the exact current canonical digest tuple.

func (UnsignedOperationPlan) Format

func (p UnsignedOperationPlan) Format(state fmt.State, _ rune)

Format routes every plan formatting form through the redacted summary.

func (UnsignedOperationPlan) GenerationFacts

func (p UnsignedOperationPlan) GenerationFacts() PlanGenerationFacts

GenerationFacts returns bounded inverse-generation facts.

func (UnsignedOperationPlan) GoString

func (p UnsignedOperationPlan) GoString() string

GoString returns a constant secret-safe plan Go representation.

func (UnsignedOperationPlan) HasNewInstance

func (p UnsignedOperationPlan) HasNewInstance() bool

HasNewInstance reports whether the plan emits one Message-Instance field.

func (UnsignedOperationPlan) HighestInstance

func (p UnsignedOperationPlan) HighestInstance() uint64

HighestInstance returns the highest inherited instance number.

func (UnsignedOperationPlan) MessageInstance

func (p UnsignedOperationPlan) MessageInstance() (instance.MessageInstance, bool)

MessageInstance returns the immutable generated instance model when present.

func (UnsignedOperationPlan) ModificationFacts

func (p UnsignedOperationPlan) ModificationFacts() ModificationFacts

ModificationFacts returns exact sealed policy-comparison facts.

func (UnsignedOperationPlan) NewInstanceNumber

func (p UnsignedOperationPlan) NewInstanceNumber() uint64

NewInstanceNumber returns the generated instance number or zero.

func (UnsignedOperationPlan) NextSequence

func (p UnsignedOperationPlan) NextSequence() uint64

NextSequence returns the exactly reserved new signature sequence.

func (UnsignedOperationPlan) RenderedInstance

func (p UnsignedOperationPlan) RenderedInstance() []byte

RenderedInstance returns detached exact Message-Instance field bytes.

func (UnsignedOperationPlan) Role

Role returns the exact hash-derived role.

func (UnsignedOperationPlan) SignatureInstance

func (p UnsignedOperationPlan) SignatureInstance() uint64

SignatureInstance returns the instance referenced by the future signature.

func (UnsignedOperationPlan) SizeFacts

func (p UnsignedOperationPlan) SizeFacts() PlanSizeFacts

SizeFacts returns exact known pre-sign sizes and reserved counts.

func (UnsignedOperationPlan) String

func (p UnsignedOperationPlan) String() string

String returns a constant secret-safe plan summary.

func (UnsignedOperationPlan) Valid

func (p UnsignedOperationPlan) Valid() bool

Valid reports whether the plan is a coherent unsigned operation.

type Usage

type Usage struct {
	// contains filtered or unexported fields
}

Usage stores one immutable snapshot of bounded signing work.

func (Usage) Count

func (u Usage) Count(resource Resource) int

Count returns the charged count for a closed resource.

func (Usage) Valid

func (u Usage) Valid() bool

Valid reports whether usage was initialized with nonnegative counters.

type UsageCounter

type UsageCounter struct {
	// contains filtered or unexported fields
}

UsageCounter transactionally owns one operation's usage counters.

func NewUsageCounter

func NewUsageCounter(limits Limits) (*UsageCounter, error)

NewUsageCounter constructs a counter under resolved restrictive limits.

func (*UsageCounter) Charge

func (c *UsageCounter) Charge(resource Resource, count int) error

Charge transactionally accounts for one nonnegative resource increment.

func (*UsageCounter) Finalize

func (c *UsageCounter) Finalize() error

Finalize validates exact signing-operation completion invariants.

func (*UsageCounter) Usage

func (c *UsageCounter) Usage() Usage

Usage returns an immutable initialized accounting snapshot.

type VerifiedRevisionInput

type VerifiedRevisionInput struct {
	// contains filtered or unexported fields
}

VerifiedRevisionInput is an opaque sealed exact-input capability with no content accessor.

func (VerifiedRevisionInput) Format

func (c VerifiedRevisionInput) Format(state fmt.State, _ rune)

Format routes every capability formatting form through the redacted summary.

func (VerifiedRevisionInput) GoString

func (c VerifiedRevisionInput) GoString() string

GoString returns a constant secret-safe capability Go representation.

func (VerifiedRevisionInput) IsZero

func (c VerifiedRevisionInput) IsZero() bool

IsZero reports whether no capability state was supplied.

func (VerifiedRevisionInput) String

func (c VerifiedRevisionInput) String() string

String returns a constant secret-safe capability summary.

func (VerifiedRevisionInput) Valid

func (c VerifiedRevisionInput) Valid() bool

Valid reports only whether the value has the structural shape of an issued capability.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL