Documentation
¶
Overview ¶
Package verify coordinates DKIM2 static-key verification contracts.
The package owns the library-internal verification boundary for draft-ietf-dkim-dkim2-spec-09. It consumes the raw RFC 5322 message model, the Message-Instance and DKIM2-Signature parsers, and the canonicalization helpers needed to verify every supported Message-Instance hash set. It must not reimplement raw parsing, DKIM2 tag parsing, base64string parsing, sequence validation, canonical body or header input, or Section 12.8 signature input rendering.
Verification is intentionally dependency-injected. Public keys are resolved through KeyProvider by canonical signing domain, selector, and algorithm. The default algorithm policy allows exactly rsa-sha256 and ed25519-sha256. RSA verifier policy defaults to a 1024-bit minimum so the verifier can validate the active draft-required 1024 through 2048 bit range. RSA-SHA256 verifies SHA-256 plus PKCS#1 v1.5 over Section 12.8 input bytes. Ed25519-SHA256 verifies Ed25519 over SHA-256 digest bytes of the same input.
Timestamp checks use an injected Clock or an explicit request reference instant and the fixed Draft-09 Section 14.3 windows (14 days of age, one day in the future) on every signature, so tests and callers evaluate future and stale signatures deterministically. Current SMTP envelope state is carried by immutable Envelope values. Matching follows draft-ietf-dkim-dkim2-spec-09 Sections 12.2 and 14.4: ASCII domain bytes are lowercased, local-part and non-ASCII bytes remain case-sensitive, and every current recipient must occur in the signed recipient set regardless of order or additional signed recipients. Matching does not perform Unicode normalization, IDNA mapping, sorting, or deduplication.
Result and error types expose bounded facts such as allowlisted algorithms, status names, check kinds, sequence numbers, instance numbers, and limit names. Diagnostics must not contain raw messages, raw body bytes, raw header values, full DKIM2 fields, decoded envelope paths, recipient lists, nonces, raw signatures, public-key bytes, private keys, tokens, or protected configuration values.
Verify derives one bounded flag candidate from the already parsed selected DKIM2-Signature. The candidate contains only target sequence and the five known policy booleans; it owns no raw flag text. It remains unauthenticated evidence in this package. The service layer alone may upgrade it to a sealed policy hop after the aggregate current result is PASS. Non-PASS results may retain parser evidence internally but cannot create authenticated policy facts, feedback intent, or local actions.
After aggregate current verification passes, Verify may walk authenticated Message-Instance history through the recipe parser, recipe applier, and canonical hash owner. The resulting immutable HistoryWalk records bounded reconstructed-content coverage only. It does not verify historical signatures, authenticate historical policy flags, alter current four-state truth, or project history through the service or public facade in this increment. Non-PASS results perform no recipe-history work.
Index ¶
- Constants
- func CombineSignatureSets(layout combine.Layout, sets []SignatureSetResult) combine.Outcome
- func DetectLocalHopRun(ctx context.Context, signatures []signature.Signature, completion uint64, ...) (LocalHopRun, LocalHopRunOutcome, error)
- func HashCombinationComputable(parsed instance.MessageInstance) bool
- func IsErrorCode(err error, code ErrorCode) bool
- func NewProviderFailure(class ProviderFailureClass) error
- func ProtocolApplicable(message rawmsg.Message) bool
- func SameFromState(left, right rawmsg.HeaderBlock) bool
- func SignerFromAuthenticFor(headers rawmsg.HeaderBlock, signingDomain string) bool
- func ValidProviderSource(value string) bool
- type Algorithm
- type AlgorithmPolicy
- type CheckKind
- type CheckResult
- type CheckStatus
- type Clock
- type CustodyStatus
- type DomainAlignmentStatus
- type DomainPolicyProvider
- type DomainPolicyStatus
- type EmbeddedInput
- type Envelope
- type EnvelopeStatus
- type Error
- func (e *Error) Algorithm() Algorithm
- func (e *Error) ChainOfCustodyFailure() bool
- func (e *Error) Class() ErrorClass
- func (e *Error) Code() ErrorCode
- func (e *Error) Count() int
- func (e *Error) CustodyStatus() CustodyStatus
- func (e *Error) Error() string
- func (e *Error) Is(target error) bool
- func (e *Error) Limit() int
- func (e *Error) LimitName() string
- func (e *Error) Location() ErrorLocation
- func (e *Error) SelectedTarget() (Target, bool)
- func (e *Error) Status() CheckStatus
- func (e *Error) TargetName() string
- func (e *Error) Unwrap() error
- type ErrorClass
- type ErrorCode
- type ErrorDetails
- type ErrorLocation
- type FromAuthorization
- type HashStatus
- type HeaderEvidence
- type HistoricalTargetOutcome
- type HistoricalTargetRequest
- type HistoryCoordinator
- func (c HistoryCoordinator) Descend(ctx context.Context, collection instance.Collection, initial recipe.State, ...) (RunDescent, error)
- func (c HistoryCoordinator) ValidatePrevious(state recipe.State, current, previous instance.MessageInstance) (HistoryTransition, error)
- func (c HistoryCoordinator) Walk(ctx context.Context, current Result, collection instance.Collection, ...) (HistoryWalk, error)
- type HistoryCoverage
- type HistoryDimensionState
- type HistoryLimits
- type HistoryRecipeMode
- type HistoryStopReason
- type HistoryTransition
- func (t HistoryTransition) BodyState() HistoryDimensionState
- func (t HistoryTransition) FromInstance() uint64
- func (t HistoryTransition) HeaderState() HistoryDimensionState
- func (t HistoryTransition) RecipeMode() HistoryRecipeMode
- func (t HistoryTransition) ReconstructedState() (recipe.State, bool)
- func (t HistoryTransition) ToInstance() uint64
- func (t HistoryTransition) Valid() bool
- type HistoryUsage
- type HistoryWalk
- func (w HistoryWalk) Coverage() HistoryCoverage
- func (w HistoryWalk) HadUnavailableBody() bool
- func (w HistoryWalk) ReachedInstance() uint64
- func (w HistoryWalk) StopReason() HistoryStopReason
- func (w HistoryWalk) TargetInstance() uint64
- func (w HistoryWalk) Transitions() []HistoryTransition
- func (w HistoryWalk) Usage() HistoryUsage
- func (w HistoryWalk) Valid() bool
- type KeyMetadata
- type KeyProvider
- type KeyQuery
- type KeyStatus
- type Limits
- type LocalAuthority
- type LocalAuthorityStatus
- type LocalHopRun
- func (r LocalHopRun) CompletionSequence() uint64
- func (r LocalHopRun) Format(state fmt.State, _ rune)
- func (r LocalHopRun) GoString() string
- func (r LocalHopRun) HasPreviousHop() bool
- func (r LocalHopRun) LowestSequence() uint64
- func (r LocalHopRun) Members() []uint64
- func (r LocalHopRun) PreviousHopDomain() string
- func (r LocalHopRun) PreviousHopInstance() uint64
- func (r LocalHopRun) PreviousHopIsNextDomain() bool
- func (r LocalHopRun) PreviousHopMailFrom() []byte
- func (r LocalHopRun) PreviousHopNullSender() bool
- func (r LocalHopRun) PreviousHopRecipients() [][]byte
- func (r LocalHopRun) PreviousHopSequence() uint64
- func (r LocalHopRun) PreviousHopTimestamp() uint64
- func (LocalHopRun) String() string
- func (r LocalHopRun) Valid() bool
- type LocalHopRunLimits
- type LocalHopRunOutcome
- type NextDomainStatus
- type Option
- type Options
- type PreparedRevisionProof
- type ProviderFailureClass
- type PublicKey
- type RecordedHop
- func (RecordedHop) Format(state fmt.State, _ rune)
- func (RecordedHop) GoString() string
- func (h RecordedHop) IntroducesInstance() bool
- func (h RecordedHop) MessageInstance() uint64
- func (h RecordedHop) Recipe() recipe.Descriptor
- func (h RecordedHop) RecipeMode() VerifierRecipeMode
- func (h RecordedHop) Sequence() uint64
- func (h RecordedHop) SignerDomain() string
- func (RecordedHop) String() string
- func (h RecordedHop) Valid() bool
- type ReplayProjection
- func (p ReplayProjection) Draft() string
- func (p ReplayProjection) Exploded() bool
- func (ReplayProjection) Format(state fmt.State, _ rune)
- func (ReplayProjection) GoString() string
- func (p ReplayProjection) OriginReplayAlgorithm() string
- func (p ReplayProjection) OriginReplayDigest() ([32]byte, bool)
- func (p ReplayProjection) ReplayEligible() bool
- func (ReplayProjection) String() string
- func (p ReplayProjection) Valid() bool
- type Request
- type Result
- func (r Result) Checks() []CheckResult
- func (r Result) CustodyStatus() CustodyStatus
- func (r Result) Draft() string
- func (Result) Format(state fmt.State, _ rune)
- func (Result) GoString() string
- func (r Result) ReplayProjection() (ReplayProjection, bool)
- func (r Result) SignatureLayout() combine.Layout
- func (r Result) SignatureSets() []SignatureSetResult
- func (r Result) Status() TargetStatus
- func (Result) String() string
- func (r Result) Target() Target
- func (r Result) TargetFlagCandidate() (TargetFlagCandidate, bool)
- func (r Result) WithSignatureLayout(layout combine.Layout) Result
- type RevisionCustodyFacts
- func (f RevisionCustodyFacts) Format(state fmt.State, _ rune)
- func (f RevisionCustodyFacts) GoString() string
- func (f RevisionCustodyFacts) HadNextDomain() bool
- func (f RevisionCustodyFacts) Hops() []RevisionCustodyHopFact
- func (f RevisionCustodyFacts) Status() signature.CustodyStatus
- func (f RevisionCustodyFacts) String() string
- func (f RevisionCustodyFacts) Valid() bool
- type RevisionCustodyHopFact
- type RevisionCustodyLinkStatus
- type RevisionEnvelopeState
- type RevisionFacts
- func (f RevisionFacts) Custody() RevisionCustodyFacts
- func (f RevisionFacts) Envelope() RevisionEnvelopeState
- func (f RevisionFacts) Flags() []RevisionFlagFacts
- func (f RevisionFacts) Format(state fmt.State, _ rune)
- func (f RevisionFacts) GoString() string
- func (f RevisionFacts) Hashes() RevisionHashFacts
- func (f RevisionFacts) HighestInstance() uint64
- func (f RevisionFacts) HighestSequence() uint64
- func (f RevisionFacts) History() RevisionHistoryFacts
- func (f RevisionFacts) HistoryHasUnavailableBody() bool
- func (f RevisionFacts) InstanceCount() int
- func (f RevisionFacts) SignatureCount() int
- func (f RevisionFacts) Signatures() []RevisionSignatureFact
- func (f RevisionFacts) String() string
- func (f RevisionFacts) Timestamps() []uint64
- func (f RevisionFacts) Usage() RevisionUsage
- func (f RevisionFacts) Valid() bool
- type RevisionFlagFacts
- type RevisionHashFacts
- func (f RevisionHashFacts) BodyDigest() [sha256DigestLength]byte
- func (f RevisionHashFacts) Format(state fmt.State, _ rune)
- func (f RevisionHashFacts) GoString() string
- func (f RevisionHashFacts) HeaderDigest() [sha256DigestLength]byte
- func (f RevisionHashFacts) Instance() uint64
- func (f RevisionHashFacts) String() string
- func (f RevisionHashFacts) Valid() bool
- type RevisionHistoryFacts
- func (f RevisionHistoryFacts) Coverage() HistoryCoverage
- func (f RevisionHistoryFacts) Format(state fmt.State, _ rune)
- func (f RevisionHistoryFacts) GoString() string
- func (f RevisionHistoryFacts) HasUnavailableBody() bool
- func (f RevisionHistoryFacts) Reached() uint64
- func (f RevisionHistoryFacts) Stop() HistoryStopReason
- func (f RevisionHistoryFacts) String() string
- func (f RevisionHistoryFacts) Target() uint64
- func (f RevisionHistoryFacts) Transitions() []RevisionHistoryTransitionFact
- func (f RevisionHistoryFacts) Usage() HistoryUsage
- func (f RevisionHistoryFacts) Valid() bool
- type RevisionHistoryTransitionFact
- func (f RevisionHistoryTransitionFact) Body() HistoryDimensionState
- func (f RevisionHistoryTransitionFact) From() uint64
- func (f RevisionHistoryTransitionFact) Header() HistoryDimensionState
- func (f RevisionHistoryTransitionFact) Mode() HistoryRecipeMode
- func (f RevisionHistoryTransitionFact) To() uint64
- func (f RevisionHistoryTransitionFact) Valid() bool
- type RevisionInstant
- type RevisionLimits
- type RevisionProof
- func (p RevisionProof) Draft() string
- func (p RevisionProof) Facts() RevisionFacts
- func (p RevisionProof) Format(state fmt.State, _ rune)
- func (p RevisionProof) GoString() string
- func (p RevisionProof) IsZero() bool
- func (p RevisionProof) ReplayProjection() (ReplayProjection, bool)
- func (p RevisionProof) State() RevisionProofOutcome
- func (p RevisionProof) String() string
- func (p RevisionProof) Valid() bool
- func (p RevisionProof) VerifierProjection() (VerifierProjection, bool)
- type RevisionProofOutcome
- type RevisionProofRevalidation
- type RevisionSetFact
- func (f RevisionSetFact) Algorithm() Algorithm
- func (f RevisionSetFact) Format(state fmt.State, _ rune)
- func (f RevisionSetFact) GoString() string
- func (f RevisionSetFact) Index() int
- func (f RevisionSetFact) LookedUp() bool
- func (f RevisionSetFact) State() RevisionSetState
- func (f RevisionSetFact) String() string
- func (f RevisionSetFact) Valid() bool
- type RevisionSetState
- type RevisionSignatureFact
- func (f RevisionSignatureFact) Flags() RevisionFlagFacts
- func (f RevisionSignatureFact) Format(state fmt.State, _ rune)
- func (f RevisionSignatureFact) GoString() string
- func (f RevisionSignatureFact) Instance() uint64
- func (f RevisionSignatureFact) Sequence() uint64
- func (f RevisionSignatureFact) Sets() []RevisionSetFact
- func (f RevisionSignatureFact) String() string
- func (f RevisionSignatureFact) Timestamp() uint64
- func (f RevisionSignatureFact) Valid() bool
- type RevisionUsage
- func (u RevisionUsage) CanonicalBytes() int
- func (u RevisionUsage) CurrentCanonicalBytes() int
- func (u RevisionUsage) DomainPolicyLookups() int
- func (u RevisionUsage) Format(state fmt.State, _ rune)
- func (u RevisionUsage) GoString() string
- func (u RevisionUsage) History() HistoryUsage
- func (u RevisionUsage) KeyLookups() int
- func (u RevisionUsage) ProtocolFields() int
- func (u RevisionUsage) ProviderCalls() int
- func (u RevisionUsage) SignatureCanonicalBytes() int
- func (u RevisionUsage) SignatureSets() int
- func (u RevisionUsage) String() string
- func (u RevisionUsage) Valid() bool
- type RunDescent
- func (d RunDescent) Degraded() bool
- func (d RunDescent) Failure() RunDescentFailure
- func (d RunDescent) Format(state fmt.State, _ rune)
- func (d RunDescent) GoString() string
- func (d RunDescent) Outcome() RunDescentOutcome
- func (d RunDescent) ReachedInstance() uint64
- func (d RunDescent) RewrittenHeaderNames() []string
- func (d RunDescent) State() (recipe.State, bool)
- func (RunDescent) String() string
- func (d RunDescent) Valid() bool
- type RunDescentFailure
- type RunDescentOutcome
- type RunMemberOutcome
- type SignatureSetResult
- type SignatureSetStatus
- type StaticKey
- type StaticKeyProvider
- type StaticKeyProviderOption
- type Target
- type TargetFlagCandidate
- type TargetStatus
- type TimestampStatus
- type Verifier
- func (v Verifier) CaptureRevisionInstant() (RevisionInstant, error)
- func (v Verifier) DeliveryReference(arrival time.Time) (time.Time, bool)
- func (v Verifier) DescendEmbeddedRun(ctx context.Context, embedded EmbeddedInput, initial recipe.State, ...) (RunDescent, error)
- func (v Verifier) ExecutePreparedRevisionProof(ctx context.Context, prepared PreparedRevisionProof) (RevisionProofOutcome, RevisionProof, error)
- func (v Verifier) ExtractEmbeddedInput(message rawmsg.Message) (EmbeddedInput, error)
- func (v Verifier) KeyProvider() KeyProvider
- func (v Verifier) Options() Options
- func (v Verifier) PrepareRevisionProofAt(ctx context.Context, request Request, instant RevisionInstant) (RevisionProofOutcome, PreparedRevisionProof, error)
- func (v Verifier) RevalidateRevisionProof(ctx context.Context, proof RevisionProof) (RevisionProofRevalidation, error)
- func (v Verifier) RevalidateRevisionProofAt(ctx context.Context, proof RevisionProof, instant RevisionInstant) (RevisionProofRevalidation, error)
- func (v Verifier) Valid() bool
- func (v Verifier) Verify(ctx context.Context, request Request) (Result, error)
- func (v Verifier) VerifyCurrent(ctx context.Context, request Request) (Result, error)
- func (v Verifier) VerifyDeliveryStatusComplete(ctx context.Context, request Request) (Result, error)
- func (v Verifier) VerifyDeliveryStatusHeadersOnly(ctx context.Context, request Request) (HeaderEvidence, error)
- func (v Verifier) VerifyEmbeddedSignatures(ctx context.Context, embedded EmbeddedInput, sequences []uint64) (RunMemberOutcome, error)
- func (v Verifier) VerifyHistoricalTarget(ctx context.Context, embedded EmbeddedInput, request HistoricalTargetRequest) (HistoricalTargetOutcome, error)
- func (v Verifier) VerifyRevisionProof(ctx context.Context, request Request) (RevisionProofOutcome, RevisionProof, error)
- func (v Verifier) VerifyRevisionProofAfterCurrent(ctx context.Context, request Request, current Result) (RevisionProofOutcome, RevisionProof, error)
- func (v Verifier) VerifyRevisionProofAt(ctx context.Context, request Request, instant RevisionInstant) (RevisionProofOutcome, RevisionProof, error)
- type VerifierCustodyTransition
- type VerifierHop
- func (h VerifierHop) BodyAvailability() recipe.BodyAvailability
- func (h VerifierHop) CustodyTransition() VerifierCustodyTransition
- func (h VerifierHop) Flags() RevisionFlagFacts
- func (VerifierHop) Format(state fmt.State, _ rune)
- func (VerifierHop) GoString() string
- func (h VerifierHop) HistoryBodyState() HistoryDimensionState
- func (h VerifierHop) HistoryHeaderState() HistoryDimensionState
- func (h VerifierHop) HopBinding() [sha256.Size]byte
- func (h VerifierHop) MessageInstance() uint64
- func (h VerifierHop) Recipe() recipe.Descriptor
- func (h VerifierHop) RecipeMode() VerifierRecipeMode
- func (h VerifierHop) Sequence() uint64
- func (h VerifierHop) SignatureAlgorithms() []Algorithm
- func (h VerifierHop) SignerDomain() string
- func (VerifierHop) String() string
- func (h VerifierHop) Valid() bool
- type VerifierProjection
- func (p VerifierProjection) Binding() [sha256.Size]byte
- func (p VerifierProjection) Draft() string
- func (VerifierProjection) Format(state fmt.State, _ rune)
- func (VerifierProjection) GoString() string
- func (p VerifierProjection) Hops() []VerifierHop
- func (p VerifierProjection) Schema() string
- func (VerifierProjection) String() string
- func (p VerifierProjection) Valid() bool
- type VerifierRecipeMode
Constants ¶
const ( // DraftBaseline identifies the active DKIM2 verification draft. DraftBaseline = "draft-ietf-dkim-dkim2-spec-09" // AlgorithmRSASHA256 identifies RSA with SHA-256 and PKCS#1 v1.5 verification. AlgorithmRSASHA256 = signature.AlgorithmRSASHA256 // AlgorithmEd25519SHA256 identifies Ed25519 verification over SHA-256 digest bytes. AlgorithmEd25519SHA256 = signature.AlgorithmEd25519SHA256 // AlgorithmMLDSA44 identifies pure ML-DSA-44 verification over the // complete Section 12.8 input with the "DKIM2" context string. AlgorithmMLDSA44 = signature.AlgorithmMLDSA44 // AlgorithmUnknown is the bounded result token for algorithms outside the active contract. AlgorithmUnknown Algorithm = "unknown" )
const ( // ProviderFailureTemporary identifies retryable provider unavailability. ProviderFailureTemporary = provider.FailureTemporary // ProviderFailurePermanent identifies unrecoverable provider failure. ProviderFailurePermanent = provider.FailurePermanent // ProviderFailureContract identifies an inconsistent or unclassified provider outcome. ProviderFailureContract = provider.FailureContract )
const (
// DefaultMaxLocalAuthorityLookups bounds distinct datasource authority lookups per run detection.
DefaultMaxLocalAuthorityLookups = 256
)
const (
// VerifierProjectionSchema identifies the stable transport-neutral projection shape.
VerifierProjectionSchema = "dkim2.verifier-projection.v1"
)
Variables ¶
This section is empty.
Functions ¶
func CombineSignatureSets ¶
func CombineSignatureSets(layout combine.Layout, sets []SignatureSetResult) combine.Outcome
CombineSignatureSets is the single owner of the Section 14.6 signature algebra for verification facts. It places each per-set result at its field-order Index and combines them under the parsed sig-any/sig-all layout; the outcome's decisive index is that field-order Index. Duplicate or missing indexes make the outcome invalid. Current verification, inherited and revision signatures, the headers-only DSN check, and the service mapping all use it.
func DetectLocalHopRun ¶
func DetectLocalHopRun(ctx context.Context, signatures []signature.Signature, completion uint64, authority LocalAuthority, limits LocalHopRunLimits) (LocalHopRun, LocalHopRunOutcome, error)
DetectLocalHopRun extends the local hop run backwards from the completion signature over Section 12.3 nd= members and same-tenant imaginary-hop members. The caller must already have proven that the completion signature verified and that its d= is a local authority domain; this function checks only the extension rules and the custody structure. It never verifies cryptography; use VerifyEmbeddedSignatures for run members.
func HashCombinationComputable ¶
func HashCombinationComputable(parsed instance.MessageInstance) bool
HashCombinationComputable reports whether at least one hash-set of the parsed h= value uses an algorithm this verifier implements, so that the Section 14.7 combination depends on a computed digest. When it is false every intermediate is PERMERROR and the combination is PERMERROR without reconstructing any state; callers use it as a cheap precondition and must otherwise evaluate the full combination, where a FAIL intermediate wins over PERMERROR.
func IsErrorCode ¶
IsErrorCode reports whether err contains a verification Error with code.
func NewProviderFailure ¶
func NewProviderFailure(class ProviderFailureClass) error
NewProviderFailure constructs a cause-free typed provider failure.
func ProtocolApplicable ¶
ProtocolApplicable reports whether an initialized message contains at least one DKIM2 protocol header and therefore requires verification.
func SameFromState ¶
func SameFromState(left, right rawmsg.HeaderBlock) bool
SameFromState reports whether two header blocks carry byte-identical From header fields, which means the From header field was not replaced.
func SignerFromAuthenticFor ¶
func SignerFromAuthenticFor(headers rawmsg.HeaderBlock, signingDomain string) bool
SignerFromAuthenticFor reports whether the From header fields of headers form one From state that signingDomain makes Authentic through the downward relaxed match only (From domain equal to or a subdomain of d=). It is the local stricter Signer rule (disposition D8): Draft-09 Sections 11.1 and 12.4 also let a subdomain d= make a parent From Authentic when the From domain's Domain Policy Record permits it, but our Signers and the DSN identity resolver only sign with keys at the correct level, so they never need the upward match and never query a Domain Policy Record.
func ValidProviderSource ¶
ValidProviderSource reports whether a source is an empty or bounded low-cardinality token.
Types ¶
type AlgorithmPolicy ¶
type AlgorithmPolicy struct {
// AllowedAlgorithms lists enabled DKIM2 signature algorithms.
AllowedAlgorithms []Algorithm
// MinRSABits is the minimum accepted RSA public key size for verification.
MinRSABits int
// MaxRSABits is the narrowable maximum accepted RSA public key size.
MaxRSABits int
}
AlgorithmPolicy contains fail-closed signature algorithm settings.
func DefaultAlgorithmPolicy ¶
func DefaultAlgorithmPolicy() AlgorithmPolicy
DefaultAlgorithmPolicy returns the active signature algorithm allowlist.
func (AlgorithmPolicy) Algorithms ¶
func (p AlgorithmPolicy) Algorithms() []Algorithm
Algorithms returns the enabled signature algorithms as an immutable copy.
func (AlgorithmPolicy) Allows ¶
func (p AlgorithmPolicy) Allows(algorithm Algorithm) bool
Allows reports whether algorithm is enabled by the policy.
func (AlgorithmPolicy) ClassifyAlgorithm ¶
func (p AlgorithmPolicy) ClassifyAlgorithm(algorithm Algorithm) KeyStatus
ClassifyAlgorithm reports the fail-closed policy state for algorithm: an algorithm this verifier does not implement is unsupported, and an implemented algorithm that local policy does not allow is disabled. A disabled algorithm is a local decision, not a key-policy rejection, so it carries KeyStatusDisabledAlgorithm, the status its typed error and the signature-set vocabulary pair with.
func (AlgorithmPolicy) Validate ¶
func (p AlgorithmPolicy) Validate() error
Validate rejects unsafe signature algorithm policy settings.
type CheckKind ¶
type CheckKind string
CheckKind identifies one verification check dimension.
const ( // CheckKindBodyHash identifies current body hash validation. CheckKindBodyHash CheckKind = "body_hash" // CheckKindHeaderHash identifies current header hash validation. CheckKindHeaderHash CheckKind = "header_hash" // CheckKindSignature identifies cryptographic signature validation. CheckKindSignature CheckKind = "signature" // CheckKindKey identifies static public-key lookup and validation. CheckKindKey CheckKind = "key" // CheckKindTimestamp identifies local timestamp policy validation. CheckKindTimestamp CheckKind = "timestamp" // CheckKindEnvelope identifies current SMTP envelope validation. CheckKindEnvelope CheckKind = "envelope" // CheckKindDomainAlignment identifies d= alignment with the signed MAIL FROM domain. CheckKindDomainAlignment CheckKind = "domain_alignment" // CheckKindNextDomain identifies nd= chain-of-custody validation. CheckKindNextDomain CheckKind = "next_domain" )
type CheckResult ¶
type CheckResult struct {
// Kind records the verification check dimension.
Kind CheckKind
// Status records the check outcome.
Status CheckStatus
// Code records an optional stable error code.
Code ErrorCode
// Algorithm records an allowlisted algorithm name when relevant.
Algorithm Algorithm
// HashStatus records typed current hash state when relevant.
HashStatus HashStatus
// TimestampStatus records local timestamp policy detail when relevant.
TimestampStatus TimestampStatus
// EnvelopeStatus records current SMTP envelope detail when relevant.
EnvelopeStatus EnvelopeStatus
// DomainAlignmentStatus records bounded d= to mf= domain alignment detail.
DomainAlignmentStatus DomainAlignmentStatus
// NextDomainStatus records bounded nd= chain detail without domain values.
NextDomainStatus NextDomainStatus
// ProviderFailureClass records typed provider detail without raw causes.
ProviderFailureClass ProviderFailureClass
// Target records bounded sequence and instance context.
Target Target
}
CheckResult records one bounded verification check fact.
type CheckStatus ¶
type CheckStatus string
CheckStatus records a stable per-check outcome.
const ( // CheckStatusNotEvaluated records a check that has not run. CheckStatusNotEvaluated CheckStatus = "not_evaluated" // CheckStatusPass records a successful check. CheckStatusPass CheckStatus = "pass" // CheckStatusFail records a failed check. CheckStatusFail CheckStatus = "fail" // CheckStatusUnsupported records a non-success unsupported state. CheckStatusUnsupported CheckStatus = "unsupported" // CheckStatusSkipped records an explicit skipped check. CheckStatusSkipped CheckStatus = "skipped" // CheckStatusNotApplicable records a check outside the selected target. CheckStatusNotApplicable CheckStatus = "not_applicable" // CheckStatusIndeterminate records a bounded non-success unknown state. CheckStatusIndeterminate CheckStatus = "indeterminate" )
func (CheckStatus) Known ¶
func (s CheckStatus) Known() bool
Known reports whether status is part of the per-check vocabulary.
type CustodyStatus ¶
type CustodyStatus string
CustodyStatus records structural nd= coverage established by protocol extraction.
const ( // CustodyStatusNotPresent reports successful extraction found no nd=. CustodyStatusNotPresent CustodyStatus = "not_present" // CustodyStatusNDLinksEvaluated reports one or more intermediate nd= links were checked. CustodyStatusNDLinksEvaluated CustodyStatus = "nd_links_evaluated" // CustodyStatusTerminalNDRequiresOOB reports the current terminal nd= requires OOB trust. CustodyStatusTerminalNDRequiresOOB CustodyStatus = "terminal_nd_requires_oob" )
func (CustodyStatus) Known ¶
func (s CustodyStatus) Known() bool
Known reports whether custody status belongs to the closed verification vocabulary.
type DomainAlignmentStatus ¶
type DomainAlignmentStatus string
DomainAlignmentStatus records signing-domain alignment with the signed reverse-path.
const ( // DomainAlignmentStatusNotChecked records a domain alignment check that has not run. DomainAlignmentStatusNotChecked DomainAlignmentStatus = "not_checked" // DomainAlignmentStatusPass records exact or label-boundary suffix alignment. DomainAlignmentStatusPass DomainAlignmentStatus = "pass" // DomainAlignmentStatusMismatch records a non-aligned signing domain. DomainAlignmentStatusMismatch DomainAlignmentStatus = "mismatch" // DomainAlignmentStatusInvalid records malformed signed reverse-path domain evidence. DomainAlignmentStatusInvalid DomainAlignmentStatus = "invalid" // DomainAlignmentStatusNotApplicable records the null reverse-path exception. DomainAlignmentStatusNotApplicable DomainAlignmentStatus = "not_applicable" )
func (DomainAlignmentStatus) Known ¶
func (s DomainAlignmentStatus) Known() bool
Known reports whether status is part of the domain-alignment vocabulary.
type DomainPolicyProvider ¶
type DomainPolicyProvider interface {
LookupDomainPolicy(ctx context.Context, domain string) (DomainPolicyStatus, error)
}
DomainPolicyProvider resolves the Domain Policy Record of one canonical A-label From domain (Draft-09 Sections 3.8 and 18). It returns a known status with a nil error, a typed temporary provider failure, or the live caller context error; every other pair is treated as an invalid record.
type DomainPolicyStatus ¶
type DomainPolicyStatus string
DomainPolicyStatus identifies one closed Draft-09 Section 3.8 Domain Policy Record result as the verifier consumes it. A temporary failure is reported by the provider as a typed temporary provider failure.
const ( // DomainPolicyAuthorized reports that subdomains of the domain may make // its From header fields Authentic (no record, or no strict flag). DomainPolicyAuthorized DomainPolicyStatus = "authorized" // DomainPolicyStrict reports a record whose f= tag carries the strict flag. DomainPolicyStrict DomainPolicyStatus = "strict" // DomainPolicyAmbiguous reports more than one record beginning with v=DKIM1. DomainPolicyAmbiguous DomainPolicyStatus = "ambiguous" // DomainPolicyInvalid reports an invalid record or a permanent lookup failure. DomainPolicyInvalid DomainPolicyStatus = "invalid" )
func (DomainPolicyStatus) Known ¶
func (s DomainPolicyStatus) Known() bool
Known reports whether the status belongs to the closed provider vocabulary.
type EmbeddedInput ¶
type EmbeddedInput struct {
// contains filtered or unexported fields
}
EmbeddedInput is the one-time, verifier-bounded extraction of an embedded original's Message-Instance and DKIM2-Signature fields. It lets callers that already verified the highest target reuse the parsed fields for run detection, run-member verification, and historical hash-tuple checks without re-parsing under different limits.
func (EmbeddedInput) Instances ¶
func (i EmbeddedInput) Instances() []instance.MessageInstance
Instances returns an independent copy of the parsed Message-Instance fields.
func (EmbeddedInput) Signatures ¶
func (i EmbeddedInput) Signatures() []signature.Signature
Signatures returns an independent copy of the parsed DKIM2-Signature fields in field order.
func (EmbeddedInput) Valid ¶
func (i EmbeddedInput) Valid() bool
Valid reports whether the input was produced by ExtractEmbeddedInput.
type Envelope ¶
type Envelope struct {
// contains filtered or unexported fields
}
Envelope stores immutable current SMTP envelope path bytes.
func NewEnvelope ¶
NewEnvelope constructs an immutable current SMTP envelope container.
func (Envelope) ForwardPaths ¶
ForwardPaths returns ordered current forward-path byte copies.
func (Envelope) RecipientCount ¶
RecipientCount returns the number of ordered forward paths.
func (Envelope) ReversePath ¶
ReversePath returns the current reverse-path bytes.
type EnvelopeStatus ¶
type EnvelopeStatus string
EnvelopeStatus records current SMTP envelope match state.
const ( // EnvelopeStatusNotChecked records an envelope check that has not run. EnvelopeStatusNotChecked EnvelopeStatus = "not_checked" // EnvelopeStatusPass records a draft-conformant current-envelope match. EnvelopeStatusPass EnvelopeStatus = "pass" // EnvelopeStatusMissing records absent required envelope evidence. EnvelopeStatusMissing EnvelopeStatus = "missing" // EnvelopeStatusMismatch records byte-level envelope mismatch. EnvelopeStatusMismatch EnvelopeStatus = "mismatch" // EnvelopeStatusInvalid records malformed parser-owned or request-owned path state. EnvelopeStatusInvalid EnvelopeStatus = "invalid" // EnvelopeStatusReversePathMismatch records a reverse-path byte mismatch. EnvelopeStatusReversePathMismatch EnvelopeStatus = "reverse_path_mismatch" // EnvelopeStatusRecipientValueMismatch records a current forward path absent from the signed recipient set. EnvelopeStatusRecipientValueMismatch EnvelopeStatus = "recipient_value_mismatch" // EnvelopeStatusNotApplicable records a disabled or non-current target check. EnvelopeStatusNotApplicable EnvelopeStatus = "not_applicable" )
func (EnvelopeStatus) Known ¶
func (s EnvelopeStatus) Known() bool
Known reports whether status is part of the envelope-status vocabulary.
type Error ¶
type Error struct {
// contains filtered or unexported fields
}
Error is a typed, secret-safe verification error.
func (*Error) ChainOfCustodyFailure ¶
ChainOfCustodyFailure reports whether the error is a completed Draft-09 Section 14.4 Chain of Custody failure rather than a malformed or missing protocol state.
func (*Error) Class ¶
func (e *Error) Class() ErrorClass
Class returns the stable operational error class.
func (*Error) CustodyStatus ¶
func (e *Error) CustodyStatus() CustodyStatus
CustodyStatus returns established whole-sequence coverage for chain errors.
func (*Error) Error ¶
Error returns a bounded diagnostic without message, envelope, signature, or key bytes.
func (*Error) Location ¶
func (e *Error) Location() ErrorLocation
Location returns bounded verification location metadata.
func (*Error) SelectedTarget ¶
SelectedTarget returns the verification target that was already selected when a Draft-09 Section 14.4 Chain of Custody check failed, so the failure can be reported for that target instead of as a pre-target error.
func (*Error) Status ¶
func (e *Error) Status() CheckStatus
Status returns the safe check status associated with the error.
func (*Error) TargetName ¶
TargetName returns the allowlisted target class associated with the error.
type ErrorClass ¶
type ErrorClass string
ErrorClass groups verification failures for stable callers.
const ( // ErrorClassInvariant classifies invalid options or internal invariants. ErrorClassInvariant ErrorClass = "invariant" // ErrorClassRequest classifies invalid request shapes. ErrorClassRequest ErrorClass = "request" // ErrorClassLimit classifies resource-limit failures. ErrorClassLimit ErrorClass = "limit" // ErrorClassAlgorithm classifies unsupported or disabled algorithm state. ErrorClassAlgorithm ErrorClass = "algorithm" // ErrorClassUnsupported classifies behavior the current verifier cannot reconstruct safely. ErrorClassUnsupported ErrorClass = "unsupported" // ErrorClassKey classifies key lookup or key validation failures. ErrorClassKey ErrorClass = "key" // ErrorClassMalformed classifies malformed parser-owned state. ErrorClassMalformed ErrorClass = "malformed" // ErrorClassMissing classifies missing required verification targets. ErrorClassMissing ErrorClass = "missing" // ErrorClassDuplicate classifies duplicate verification targets. ErrorClassDuplicate ErrorClass = "duplicate" // ErrorClassHash classifies body or header hash mismatch. ErrorClassHash ErrorClass = "hash" // ErrorClassSignature classifies cryptographic signature failure. ErrorClassSignature ErrorClass = "signature" // ErrorClassTimestamp classifies timestamp policy failure. ErrorClassTimestamp ErrorClass = "timestamp" // ErrorClassEnvelope classifies current-envelope mismatch. ErrorClassEnvelope ErrorClass = "envelope" // ErrorClassNextDomain classifies nd= chain validation failures. ErrorClassNextDomain ErrorClass = "next_domain" // ErrorClassCustody classifies complete custody-chain validation failures. ErrorClassCustody ErrorClass = "custody" // ErrorClassInternal classifies package misuse not derived from message input. ErrorClassInternal ErrorClass = "internal" )
type ErrorCode ¶
type ErrorCode string
ErrorCode identifies a bounded verification failure.
const ( // ErrorCodeInvalidOptions reports unsafe verifier construction settings. ErrorCodeInvalidOptions ErrorCode = "invalid_options" // ErrorCodeInvalidRequest reports unsafe verifier request shape. ErrorCodeInvalidRequest ErrorCode = "invalid_request" // ErrorCodeLimitExceeded reports a verification resource-limit violation. ErrorCodeLimitExceeded ErrorCode = "limit_exceeded" // ErrorCodeUnsupportedAlgorithm reports an algorithm outside the active contract. ErrorCodeUnsupportedAlgorithm ErrorCode = "unsupported_algorithm" // ErrorCodeUnsupportedTarget reports a target requiring unavailable historical message bytes. ErrorCodeUnsupportedTarget ErrorCode = "unsupported_target" // ErrorCodeDisabledAlgorithm reports an algorithm disabled by local policy. ErrorCodeDisabledAlgorithm ErrorCode = "disabled_algorithm" // ErrorCodeMissingKey reports absent public key material. ErrorCodeMissingKey ErrorCode = "missing_key" // ErrorCodeAmbiguousKey reports multiple matching public keys. ErrorCodeAmbiguousKey ErrorCode = "ambiguous_key" // ErrorCodeInvalidKey reports malformed or mismatched public key material. ErrorCodeInvalidKey ErrorCode = "invalid_key" // ErrorCodeRevokedKey reports an explicitly revoked DNS public key. ErrorCodeRevokedKey ErrorCode = "revoked_key" // ErrorCodeUnsupportedKeyType reports an unsupported DNS key type. ErrorCodeUnsupportedKeyType ErrorCode = "unsupported_key_type" // ErrorCodeKeyAlgorithmMismatch reports disagreement between a signature algorithm and DNS key type. ErrorCodeKeyAlgorithmMismatch ErrorCode = "key_algorithm_mismatch" // ErrorCodeWrongKeyType reports key material with the wrong Go public-key type. ErrorCodeWrongKeyType ErrorCode = "wrong_key_type" // ErrorCodeKeyPolicyRejected reports a key rejected by local policy. ErrorCodeKeyPolicyRejected ErrorCode = "key_policy_rejected" // ErrorCodeProviderError reports a bounded key-provider failure. ErrorCodeProviderError ErrorCode = "provider_error" // ErrorCodeMalformedState reports malformed parser-owned verification state. ErrorCodeMalformedState ErrorCode = "malformed_state" // ErrorCodeDuplicateHashAlgorithm reports a repeated h= algorithm name. ErrorCodeDuplicateHashAlgorithm ErrorCode = "duplicate_hash_algorithm" // ErrorCodeInvalidRecipeJSON reports malformed authenticated r= JSON. ErrorCodeInvalidRecipeJSON ErrorCode = "invalid_recipe_json" // ErrorCodeDuplicateSelector reports a repeated selector within one signature field. ErrorCodeDuplicateSelector ErrorCode = "duplicate_selector" // ErrorCodeSequenceInvalid reports non-contiguous or duplicate extracted numbering. ErrorCodeSequenceInvalid ErrorCode = "sequence_invalid" // ErrorCodeMissingTarget reports a missing signature or instance target. ErrorCodeMissingTarget ErrorCode = "missing_target" // ErrorCodeDuplicateTarget reports duplicate signature or instance targets. ErrorCodeDuplicateTarget ErrorCode = "duplicate_target" // ErrorCodeHashMismatch reports body or header hash mismatch. ErrorCodeHashMismatch ErrorCode = "hash_mismatch" // ErrorCodeSignatureMismatch reports cryptographic signature mismatch. ErrorCodeSignatureMismatch ErrorCode = "signature_mismatch" // ErrorCodeTimestampInvalid reports timestamp policy failure. ErrorCodeTimestampInvalid ErrorCode = "timestamp_invalid" // ErrorCodeEnvelopeMismatch reports current-envelope mismatch. ErrorCodeEnvelopeMismatch ErrorCode = "envelope_mismatch" // ErrorCodeDomainAlignmentMismatch reports d= and mf= domain misalignment. ErrorCodeDomainAlignmentMismatch ErrorCode = "domain_alignment_mismatch" // ErrorCodeNextDomainMismatch reports nd= not matching the next signature d=. ErrorCodeNextDomainMismatch ErrorCode = "next_domain_mismatch" // ErrorCodeMissingNextSignature reports nd= without its immediate successor signature. ErrorCodeMissingNextSignature ErrorCode = "missing_next_signature" // ErrorCodeCustodyMismatch reports an invalid ordinary or mixed custody transition. ErrorCodeCustodyMismatch ErrorCode = "custody_mismatch" // ErrorCodeOutOfBandRequired reports terminal nd= requiring unavailable OOB acceptance. ErrorCodeOutOfBandRequired ErrorCode = "out_of_band_required" // ErrorCodeInternalMisuse reports invalid internal verifier API use. ErrorCodeInternalMisuse ErrorCode = "internal_misuse" // ErrorCodeHistoryInvalidOptions reports invalid history coordinator limits. ErrorCodeHistoryInvalidOptions ErrorCode = "history_invalid_options" // ErrorCodeHistoryInvalidState reports direct incoherent history inputs. ErrorCodeHistoryInvalidState ErrorCode = "history_invalid_state" // ErrorCodeHistoryInstanceNotAdjacent reports invalid m= transition ordering. ErrorCodeHistoryInstanceNotAdjacent ErrorCode = "history_instance_not_adjacent" // ErrorCodeHistoryLimitExceeded reports a cumulative history ceiling. ErrorCodeHistoryLimitExceeded ErrorCode = "history_limit_exceeded" // ErrorCodeHistoryInternalContract reports an impossible coordinator state. ErrorCodeHistoryInternalContract ErrorCode = "history_internal_contract" )
type ErrorDetails ¶
type ErrorDetails struct {
// Class records the stable operational class for the error.
Class ErrorClass
// Algorithm records a safe signature algorithm name.
Algorithm Algorithm
// Status records a safe per-check status token.
Status CheckStatus
// LimitName records the resource limit identifier for structured callers.
LimitName string
// Limit records the configured limit when relevant.
Limit int
// Count records the observed count or size when relevant.
Count int
// TargetName records an allowlisted target class such as dkim2_signature.
TargetName string
}
ErrorDetails carries bounded metadata for Error.
type ErrorLocation ¶
type ErrorLocation struct {
// Check records the verification check dimension.
Check CheckKind
// SignatureIndex records a zero-based s= set position when relevant.
SignatureIndex int
// TargetSequence records a DKIM2-Signature i= value when relevant.
TargetSequence uint64
// InstanceNumber records a Message-Instance m= value when relevant.
InstanceNumber uint64
}
ErrorLocation identifies bounded verification context.
type FromAuthorization ¶
type FromAuthorization struct {
// contains filtered or unexported fields
}
FromAuthorization is the explicit verifier choice for the Draft-09 Section 11.1 upward Authentic From match. Exactly one of a Domain Policy Record provider or the local downward-only policy must be chosen; the zero value is not a choice and verifier construction fails closed on it (D9).
func DownwardOnlyFromAuthorization ¶
func DownwardOnlyFromAuthorization() FromAuthorization
DownwardOnlyFromAuthorization selects the documented local policy that never uses the upward match, so a From state is Authentic only when d= is equal to or a parent of the From domain, and no Domain Policy Record is ever queried.
func SubdomainFromAuthorization ¶
func SubdomainFromAuthorization(provider DomainPolicyProvider) FromAuthorization
SubdomainFromAuthorization selects the conforming Draft-09 behavior: an upward match makes a From state Authentic unless the From domain's Domain Policy Record, resolved through provider, carries the strict flag.
type HashStatus ¶
type HashStatus string
HashStatus records body or header hash validation state.
const ( // HashStatusNotChecked records a hash check that has not run. HashStatusNotChecked HashStatus = "not_checked" // HashStatusPass records matching supported advertised digests. HashStatusPass HashStatus = "pass" // HashStatusMismatch records a non-matching supported advertised digest. HashStatusMismatch HashStatus = "mismatch" // HashStatusUnsupported records only unsupported hash algorithms. HashStatusUnsupported HashStatus = "unsupported" // HashStatusInvalid records malformed parser-owned hash state. HashStatusInvalid HashStatus = "invalid" )
func (HashStatus) Known ¶
func (s HashStatus) Known() bool
Known reports whether status is part of the hash-status vocabulary.
type HeaderEvidence ¶
type HeaderEvidence struct {
// contains filtered or unexported fields
}
HeaderEvidence records bounded authentication facts for a DSN text/rfc822-headers embedded original. It deliberately does not represent body-hash evidence and therefore cannot be used as a generic verification result.
func (HeaderEvidence) Status ¶
func (e HeaderEvidence) Status() TargetStatus
Status returns the bounded authentication outcome for the retained header evidence.
func (HeaderEvidence) Target ¶
func (e HeaderEvidence) Target() Target
Target returns the authenticated highest embedded DKIM2 target identifiers.
func (HeaderEvidence) Valid ¶
func (e HeaderEvidence) Valid() bool
Valid reports whether the dedicated header-only evidence is cryptographically complete for its restricted DSN purpose.
type HistoricalTargetOutcome ¶
type HistoricalTargetOutcome string
HistoricalTargetOutcome is the closed result of verifying one historical DKIM2-Signature over a reconstructed state.
const ( // HistoricalTargetVerified reports hash, signature, timestamp, and alignment success. HistoricalTargetVerified HistoricalTargetOutcome = "verified" // HistoricalTargetHashMismatch reports a state whose digests differ from the target instance. HistoricalTargetHashMismatch HistoricalTargetOutcome = "hash_mismatch" // HistoricalTargetSignatureUnverified reports a permanent signature or key failure. HistoricalTargetSignatureUnverified HistoricalTargetOutcome = "signature_unverified" // HistoricalTargetTimestampRejected reports a t= outside the window at the reference instant. HistoricalTargetTimestampRejected HistoricalTargetOutcome = "timestamp_rejected" // HistoricalTargetAlignmentRejected reports a failed Section 14.4 d=/mf= match of the target itself. HistoricalTargetAlignmentRejected HistoricalTargetOutcome = "alignment_rejected" // HistoricalTargetCustodyRejected reports a broken custody link in the chain below and including the target. HistoricalTargetCustodyRejected HistoricalTargetOutcome = "custody_rejected" // HistoricalTargetNullSender reports a target whose mf= is the null reverse path. HistoricalTargetNullSender HistoricalTargetOutcome = "null_sender" // HistoricalTargetTemporary reports a typed temporary key-provider failure. HistoricalTargetTemporary HistoricalTargetOutcome = "temporary" )
func (HistoricalTargetOutcome) Known ¶
func (o HistoricalTargetOutcome) Known() bool
Known reports whether the outcome belongs to the closed vocabulary.
type HistoricalTargetRequest ¶
type HistoricalTargetRequest struct {
// State is the proven reconstruction at the instance referenced by the target.
State recipe.State
// Sequence selects the non-highest DKIM2-Signature i= to verify.
Sequence uint64
// ReferenceTime is the instant at which the Section 10.4 window is evaluated.
ReferenceTime time.Time
// MaxTimestamp is the t= the target must not exceed, the completion instant.
MaxTimestamp uint64
}
HistoricalTargetRequest binds one reconstructed state to the historical signature that must verify over it.
func (HistoricalTargetRequest) Format ¶
func (r HistoricalTargetRequest) Format(state fmt.State, _ rune)
Format routes every request formatting form through the redacted summary.
func (HistoricalTargetRequest) GoString ¶
func (r HistoricalTargetRequest) GoString() string
GoString returns the constant secret-safe request Go representation.
func (HistoricalTargetRequest) String ¶
func (HistoricalTargetRequest) String() string
String returns a constant secret-safe request summary.
type HistoryCoordinator ¶
type HistoryCoordinator struct {
// contains filtered or unexported fields
}
HistoryCoordinator owns parsing, application, canonicalization, and cumulative policy.
func NewHistoryCoordinator ¶
func NewHistoryCoordinator(parser recipe.Parser, applier recipe.Applier, canonicalizer canonical.Canonicalizer, limits HistoryLimits) (HistoryCoordinator, error)
NewHistoryCoordinator constructs one bounded internal history coordinator.
func (HistoryCoordinator) Descend ¶
func (c HistoryCoordinator) Descend(ctx context.Context, collection instance.Collection, initial recipe.State, floor uint64, maxCanonicalBytes int) (RunDescent, error)
Descend walks initial, the proven state of the highest instance of collection, down to the floor instance by applying each authenticated recipe and re-proving every intermediate state against its Message-Instance hashes. The initial state may be headers-only; its header hash, and its body hash when known, are re-proven against the highest instance before the first transition so that a caller cannot inject an unproven state. An unsupported tuple, a limit, a malformed recipe, an unavailable source, or a mismatch makes the descent not reconstructable. maxCanonicalBytes is the aggregate Section 6 canonical work ceiling shared by the initial-state proof and every transition; exhausting it is a limit failure, never a partial state.
func (HistoryCoordinator) ValidatePrevious ¶
func (c HistoryCoordinator) ValidatePrevious(state recipe.State, current, previous instance.MessageInstance) (HistoryTransition, error)
ValidatePrevious compares reconstructed content against one adjacent previous instance.
func (HistoryCoordinator) Walk ¶
func (c HistoryCoordinator) Walk(ctx context.Context, current Result, collection instance.Collection, initial recipe.State) (HistoryWalk, error)
Walk reconstructs authenticated historical content after coherent current PASS.
type HistoryCoverage ¶
type HistoryCoverage string
HistoryCoverage identifies authenticated historical content coverage.
const ( // HistoryCoverageComplete reports matched content through m=1. HistoryCoverageComplete HistoryCoverage = "complete" // HistoryCoveragePartial reports bounded proof without every historical dimension. HistoryCoveragePartial HistoryCoverage = "partial" // HistoryCoverageUnreconstructable reports failure before one authenticated hop. HistoryCoverageUnreconstructable HistoryCoverage = "unreconstructable" // HistoryCoverageFailed reports a supported historical hash mismatch. HistoryCoverageFailed HistoryCoverage = "failed" // HistoryCoverageUnsupported reports an unsupported first historical hash tuple. HistoryCoverageUnsupported HistoryCoverage = "unsupported" )
func (HistoryCoverage) Known ¶
func (c HistoryCoverage) Known() bool
Known reports whether coverage belongs to the closed history vocabulary.
type HistoryDimensionState ¶
type HistoryDimensionState string
HistoryDimensionState identifies one historical content comparison.
const ( // HistoryDimensionMatched reports equal supported digests. HistoryDimensionMatched HistoryDimensionState = "matched" // HistoryDimensionMismatch reports unequal supported digests. HistoryDimensionMismatch HistoryDimensionState = "mismatch" HistoryDimensionUnavailable HistoryDimensionState = "unavailable" // HistoryDimensionUnsupported reports an unknown-only expected hash algorithm. HistoryDimensionUnsupported HistoryDimensionState = "unsupported" )
func (HistoryDimensionState) Known ¶
func (s HistoryDimensionState) Known() bool
Known reports whether state belongs to the closed dimension vocabulary.
type HistoryLimits ¶
type HistoryLimits struct {
// MaxTransitions bounds evaluated adjacent hops.
MaxTransitions int
// MaxCumulativeDecodedBytes bounds parsed recipe bytes.
MaxCumulativeDecodedBytes int
// MaxCumulativeEmittedBytes bounds reconstructed bytes.
MaxCumulativeEmittedBytes int
// MaxCumulativeItems bounds structural and output items.
MaxCumulativeItems int
// MaxCumulativeWorkUnits bounds aggregate recipe work.
MaxCumulativeWorkUnits int
// MaxRetainedTransitions bounds retained immutable transition details.
MaxRetainedTransitions int
}
HistoryLimits bounds one authenticated historical walk.
func DefaultHistoryLimits ¶
func DefaultHistoryLimits() HistoryLimits
DefaultHistoryLimits returns hard cumulative ceilings.
type HistoryRecipeMode ¶
type HistoryRecipeMode string
HistoryRecipeMode identifies the fixed recipe transition mode.
const ( // HistoryRecipeModeApplied reports one parsed and applied r= transition. HistoryRecipeModeApplied HistoryRecipeMode = "applied" // HistoryRecipeModeUnchanged reports an absent recipe and unchanged state. HistoryRecipeModeUnchanged HistoryRecipeMode = "unchanged" )
func (HistoryRecipeMode) Known ¶
func (m HistoryRecipeMode) Known() bool
Known reports whether mode belongs to the closed recipe-mode vocabulary.
type HistoryStopReason ¶
type HistoryStopReason string
HistoryStopReason identifies why authenticated descent stopped.
const ( // HistoryStopOriginReached reports descent through m=1. HistoryStopOriginReached HistoryStopReason = "origin_reached" // HistoryStopRecipeInvalid reports authenticated recipe text that is not // valid JSON or whose root is not a JSON object. HistoryStopRecipeInvalid HistoryStopReason = "recipe_invalid" // HistoryStopRecipeSchemaInvalid reports valid recipe JSON whose schema, // steps, ranges, or literals are invalid. HistoryStopRecipeSchemaInvalid HistoryStopReason = "recipe_schema_invalid" // HistoryStopApplicationInvalid reports invalid recipe application. HistoryStopApplicationInvalid HistoryStopReason = "application_invalid" HistoryStopSourceUnavailable HistoryStopReason = "source_unavailable" // HistoryStopLimitExceeded reports a cumulative or per-operation ceiling. HistoryStopLimitExceeded HistoryStopReason = "limit_exceeded" // HistoryStopHashMismatch reports a supported historical digest mismatch. HistoryStopHashMismatch HistoryStopReason = "hash_mismatch" // HistoryStopHashUnsupported reports an unknown-only historical hash tuple. HistoryStopHashUnsupported HistoryStopReason = "unsupported_hash" // HistoryStopInternalContract reports an impossible internal state. HistoryStopInternalContract HistoryStopReason = "internal_contract" )
func (HistoryStopReason) Known ¶
func (r HistoryStopReason) Known() bool
Known reports whether reason belongs to the closed stop vocabulary.
type HistoryTransition ¶
type HistoryTransition struct {
// contains filtered or unexported fields
}
HistoryTransition stores one immutable adjacent authenticated reconstruction.
func (HistoryTransition) BodyState ¶
func (t HistoryTransition) BodyState() HistoryDimensionState
BodyState returns historical body comparison or availability state.
func (HistoryTransition) FromInstance ¶
func (t HistoryTransition) FromInstance() uint64
FromInstance returns the m= number owning the applied recipe.
func (HistoryTransition) HeaderState ¶
func (t HistoryTransition) HeaderState() HistoryDimensionState
HeaderState returns historical header comparison state.
func (HistoryTransition) RecipeMode ¶
func (t HistoryTransition) RecipeMode() HistoryRecipeMode
RecipeMode returns the fixed applied transition mode.
func (HistoryTransition) ReconstructedState ¶
func (t HistoryTransition) ReconstructedState() (recipe.State, bool)
ReconstructedState returns immutable reconstructed content when valid.
func (HistoryTransition) ToInstance ¶
func (t HistoryTransition) ToInstance() uint64
ToInstance returns the reconstructed adjacent m= number.
func (HistoryTransition) Valid ¶
func (t HistoryTransition) Valid() bool
Valid reports whether transition is adjacent and dimensionally coherent.
type HistoryUsage ¶
type HistoryUsage struct {
// contains filtered or unexported fields
}
HistoryUsage stores cumulative recipe-owned operation usage.
func (HistoryUsage) CanonicalBytes ¶
func (u HistoryUsage) CanonicalBytes() int
CanonicalBytes returns cumulative Section 6 canonical input bytes.
func (HistoryUsage) DecodedBytes ¶
func (u HistoryUsage) DecodedBytes() int
DecodedBytes returns cumulative decoded recipe bytes.
func (HistoryUsage) EmittedBytes ¶
func (u HistoryUsage) EmittedBytes() int
EmittedBytes returns cumulative reconstructed bytes.
func (HistoryUsage) Items ¶
func (u HistoryUsage) Items() int
Items returns cumulative structural and output items.
func (HistoryUsage) Valid ¶
func (u HistoryUsage) Valid() bool
Valid reports whether usage is initialized and nonnegative.
func (HistoryUsage) WorkUnits ¶
func (u HistoryUsage) WorkUnits() int
WorkUnits returns cumulative recipe operation work.
type HistoryWalk ¶
type HistoryWalk struct {
// contains filtered or unexported fields
}
HistoryWalk stores one bounded authenticated content descent.
func (HistoryWalk) Coverage ¶
func (w HistoryWalk) Coverage() HistoryCoverage
Coverage returns authoritative authenticated historical coverage.
func (HistoryWalk) HadUnavailableBody ¶
func (w HistoryWalk) HadUnavailableBody() bool
HadUnavailableBody reports whether the walk crossed an explicit b:null Recipe, below which body hashes cannot be checked.
func (HistoryWalk) ReachedInstance ¶
func (w HistoryWalk) ReachedInstance() uint64
ReachedInstance returns the earliest evaluated m= number.
func (HistoryWalk) StopReason ¶
func (w HistoryWalk) StopReason() HistoryStopReason
StopReason returns the closed reason descent stopped.
func (HistoryWalk) TargetInstance ¶
func (w HistoryWalk) TargetInstance() uint64
TargetInstance returns the current target m= number.
func (HistoryWalk) Transitions ¶
func (w HistoryWalk) Transitions() []HistoryTransition
Transitions returns cloned retained transition facts.
func (HistoryWalk) Usage ¶
func (w HistoryWalk) Usage() HistoryUsage
Usage returns cumulative recipe-owned accounting.
func (HistoryWalk) Valid ¶
func (w HistoryWalk) Valid() bool
Valid reports whether retained facts and authoritative fold metadata agree.
type KeyMetadata ¶
type KeyMetadata struct {
// Status records the provider result class.
Status KeyStatus
// Source records a low-cardinality provider source token.
Source string
}
KeyMetadata carries bounded key-provider facts without key bytes.
type KeyProvider ¶
KeyProvider resolves public verification keys by canonical lookup tuple.
type KeyQuery ¶
type KeyQuery struct {
// Domain is the canonical d= signing domain.
Domain string
// Selector is the canonical s= selector.
Selector string
// Algorithm is the canonical signature algorithm name.
Algorithm Algorithm
}
KeyQuery identifies one canonical static-key lookup.
type KeyStatus ¶
type KeyStatus string
KeyStatus records provider and key validation state.
const ( // KeyStatusNotChecked records a key lookup that has not run. KeyStatusNotChecked KeyStatus = "not_checked" // KeyStatusFound records a key lookup that returned usable material. KeyStatusFound KeyStatus = "found" // KeyStatusMissing records absent key material. KeyStatusMissing KeyStatus = "missing" // KeyStatusInvalid records malformed or mismatched key material. KeyStatusInvalid KeyStatus = "invalid" // KeyStatusAmbiguous records multiple matching key records. KeyStatusAmbiguous KeyStatus = "ambiguous" // KeyStatusRevoked records an explicitly revoked DNS public key. KeyStatusRevoked KeyStatus = "revoked" // KeyStatusUnsupportedKeyType records an unsupported DNS key type. KeyStatusUnsupportedKeyType KeyStatus = "unsupported_key_type" // KeyStatusAlgorithmMismatch records disagreement between requested algorithm and DNS key type. KeyStatusAlgorithmMismatch KeyStatus = "algorithm_mismatch" // KeyStatusWrongType records key material with the wrong Go public-key type. KeyStatusWrongType KeyStatus = "wrong_type" // KeyStatusPolicyRejected records a key or algorithm rejected by local policy. KeyStatusPolicyRejected KeyStatus = "policy_rejected" // KeyStatusUnsupportedAlgorithm records an unsupported algorithm lookup. KeyStatusUnsupportedAlgorithm KeyStatus = "unsupported_algorithm" // KeyStatusDisabledAlgorithm records a disabled algorithm lookup. KeyStatusDisabledAlgorithm KeyStatus = "disabled_algorithm" // KeyStatusProviderError records an internal provider failure. KeyStatusProviderError KeyStatus = "provider_error" // KeyStatusProviderTemporary records typed retryable provider failure. KeyStatusProviderTemporary KeyStatus = "provider_temporary" // KeyStatusProviderPermanent records typed unrecoverable provider failure. KeyStatusProviderPermanent KeyStatus = "provider_permanent" // KeyStatusProviderContract records inconsistent provider behavior. KeyStatusProviderContract KeyStatus = "provider_contract" )
type Limits ¶
type Limits struct {
// MaxInstanceHashSets bounds h= sets parsed from one Message-Instance.
MaxInstanceHashSets int
// MaxSignatureSets bounds signature sets evaluated for one DKIM2-Signature.
MaxSignatureSets int
// MaxEnvelopeRecipients bounds current forward-path values in one request.
MaxEnvelopeRecipients int
}
Limits contains fail-closed verification resource settings.
func DefaultLimits ¶
func DefaultLimits() Limits
DefaultLimits returns restrictive verification resource defaults.
type LocalAuthority ¶
type LocalAuthority interface {
LookupLocalAuthority(ctx context.Context, domain string) (LocalAuthorityStatus, error)
}
LocalAuthority answers whether a canonical DNS domain is a local authority domain for the tenant the implementation was bound to. Any returned error is a temporary failure; a status outside the closed vocabulary is a contract violation and is also treated as temporary. Implementations never receive a malformed domain.
type LocalAuthorityStatus ¶
type LocalAuthorityStatus string
LocalAuthorityStatus is the closed answer of one local-authority lookup.
const ( // LocalAuthorityLocal reports that the caller's tenant holds an active signing profile for the domain. LocalAuthorityLocal LocalAuthorityStatus = "local" // LocalAuthorityNotLocal reports that the domain is not a local authority domain for the tenant. LocalAuthorityNotLocal LocalAuthorityStatus = "not_local" )
func (LocalAuthorityStatus) Known ¶
func (s LocalAuthorityStatus) Known() bool
Known reports whether the status belongs to the closed vocabulary.
type LocalHopRun ¶
type LocalHopRun struct {
// contains filtered or unexported fields
}
LocalHopRun is the immutable maximal contiguous suffix of a verified embedded signature chain created by the local system, plus bounded facts about the signature directly below it.
func (LocalHopRun) CompletionSequence ¶
func (r LocalHopRun) CompletionSequence() uint64
CompletionSequence returns the i= of the completion signature.
func (LocalHopRun) Format ¶
func (r LocalHopRun) Format(state fmt.State, _ rune)
Format routes every run formatting form through the redacted summary.
func (LocalHopRun) GoString ¶
func (r LocalHopRun) GoString() string
GoString returns the constant secret-safe run Go representation.
func (LocalHopRun) HasPreviousHop ¶
func (r LocalHopRun) HasPreviousHop() bool
HasPreviousHop reports whether a signature exists directly below the run.
func (LocalHopRun) LowestSequence ¶
func (r LocalHopRun) LowestSequence() uint64
LowestSequence returns the i= of the lowest run member.
func (LocalHopRun) Members ¶
func (r LocalHopRun) Members() []uint64
Members returns the run member sequences in ascending order.
func (LocalHopRun) PreviousHopDomain ¶
func (r LocalHopRun) PreviousHopDomain() string
PreviousHopDomain returns the previous hop's canonical d= or an empty string.
func (LocalHopRun) PreviousHopInstance ¶
func (r LocalHopRun) PreviousHopInstance() uint64
PreviousHopInstance returns the m= referenced by the previous hop or zero.
func (LocalHopRun) PreviousHopIsNextDomain ¶
func (r LocalHopRun) PreviousHopIsNextDomain() bool
PreviousHopIsNextDomain reports whether the previous hop uses the nd= custody scheme.
func (LocalHopRun) PreviousHopMailFrom ¶
func (r LocalHopRun) PreviousHopMailFrom() []byte
PreviousHopMailFrom returns a detached copy of the previous hop's exact mf= path.
func (LocalHopRun) PreviousHopNullSender ¶
func (r LocalHopRun) PreviousHopNullSender() bool
PreviousHopNullSender reports whether the previous hop carries mf=<>.
func (LocalHopRun) PreviousHopRecipients ¶
func (r LocalHopRun) PreviousHopRecipients() [][]byte
PreviousHopRecipients returns detached copies of the previous hop's exact rt= paths.
func (LocalHopRun) PreviousHopSequence ¶
func (r LocalHopRun) PreviousHopSequence() uint64
PreviousHopSequence returns the i= of the previous hop or zero.
func (LocalHopRun) PreviousHopTimestamp ¶
func (r LocalHopRun) PreviousHopTimestamp() uint64
PreviousHopTimestamp returns the previous hop's t= value or zero.
func (LocalHopRun) String ¶
func (LocalHopRun) String() string
String returns a constant secret-safe run summary.
func (LocalHopRun) Valid ¶
func (r LocalHopRun) Valid() bool
Valid reports whether the run was produced by DetectLocalHopRun.
type LocalHopRunLimits ¶
type LocalHopRunLimits struct {
// MaxAuthorityLookups bounds distinct domain lookups; zero selects the default.
MaxAuthorityLookups int
}
LocalHopRunLimits bounds one run detection.
type LocalHopRunOutcome ¶
type LocalHopRunOutcome string
LocalHopRunOutcome is the closed result of one run detection.
const ( // LocalHopRunDetected reports a complete run with bounded previous-hop facts. LocalHopRunDetected LocalHopRunOutcome = "detected" // LocalHopRunTemporary reports an authority lookup that failed temporarily or violated its contract. LocalHopRunTemporary LocalHopRunOutcome = "temporary" // LocalHopRunLimitExceeded reports that the run needed more authority lookups than permitted. LocalHopRunLimitExceeded LocalHopRunOutcome = "limit_exceeded" // LocalHopRunMalformed reports a signature chain whose custody structure is not coherent. LocalHopRunMalformed LocalHopRunOutcome = "malformed" )
func (LocalHopRunOutcome) Known ¶
func (o LocalHopRunOutcome) Known() bool
Known reports whether the outcome belongs to the closed vocabulary.
type NextDomainStatus ¶
type NextDomainStatus string
NextDomainStatus records nd= chain validation and OOB state.
const ( // NextDomainStatusNotChecked records an nd= check that has not run. NextDomainStatusNotChecked NextDomainStatus = "not_checked" // NextDomainStatusPass records exact canonical nd= to next d= matching. NextDomainStatusPass NextDomainStatus = "pass" // NextDomainStatusMismatch records a non-matching next signing domain. NextDomainStatusMismatch NextDomainStatus = "mismatch" // NextDomainStatusMissingNext records an absent immediate successor signature. NextDomainStatusMissingNext NextDomainStatus = "missing_next" // NextDomainStatusOutOfBandRequired records terminal nd= state requiring OOB acceptance. NextDomainStatusOutOfBandRequired NextDomainStatus = "out_of_band_required" // NextDomainStatusNotApplicable records a signature without nd=. NextDomainStatusNotApplicable NextDomainStatus = "not_applicable" )
func (NextDomainStatus) Known ¶
func (s NextDomainStatus) Known() bool
Known reports whether status is part of the next-domain vocabulary.
type Option ¶
type Option func(*Options)
Option mutates verifier options before validation.
func WithAlgorithmPolicy ¶
func WithAlgorithmPolicy(policy AlgorithmPolicy) Option
WithAlgorithmPolicy replaces verifier algorithm policy.
func WithFromAuthorization ¶
func WithFromAuthorization(choice FromAuthorization) Option
WithFromAuthorization records the explicit Section 11.1 choice.
func WithLimits ¶
WithLimits replaces verifier resource limits.
func WithRevisionLimits ¶
func WithRevisionLimits(limits RevisionLimits) Option
WithRevisionLimits replaces cumulative all-hop proof ceilings.
type Options ¶
type Options struct {
// AlgorithmPolicy controls known signature algorithms and RSA key size.
AlgorithmPolicy AlgorithmPolicy
// Limits bounds verification result and request dimensions.
Limits Limits
// RevisionLimits bounds cumulative all-hop revision proof work.
RevisionLimits RevisionLimits
// Clock supplies deterministic current time for timestamp checks.
Clock Clock
// FromAuthorization is the explicit Draft-09 Section 11.1 choice. It has
// no default: NewVerifier rejects a missing choice (local interpretation
// D9).
FromAuthorization FromAuthorization
}
Options contains validated verifier dependencies and local policies.
func DefaultOptions ¶
func DefaultOptions() Options
DefaultOptions returns restrictive verifier defaults except for the injected key provider.
type PreparedRevisionProof ¶
type PreparedRevisionProof struct {
// contains filtered or unexported fields
}
PreparedRevisionProof is an opaque provider-free all-hop verification plan.
func (PreparedRevisionProof) Format ¶
func (p PreparedRevisionProof) Format(state fmt.State, _ rune)
Format routes every prepared-proof formatting form through the redacted summary.
func (PreparedRevisionProof) GoString ¶
func (p PreparedRevisionProof) GoString() string
GoString returns the constant secret-safe prepared-proof Go representation.
func (PreparedRevisionProof) String ¶
func (p PreparedRevisionProof) String() string
String returns a constant secret-safe prepared-proof summary.
func (PreparedRevisionProof) Usage ¶
func (p PreparedRevisionProof) Usage() RevisionUsage
Usage returns exact provider-free work and future callback counts.
func (PreparedRevisionProof) Valid ¶
func (p PreparedRevisionProof) Valid() bool
Valid reports whether the prepared proof belongs to one initialized verifier operation.
type ProviderFailureClass ¶
type ProviderFailureClass = provider.FailureClass
ProviderFailureClass identifies a typed provider failure without raw cause data.
func ProviderFailureClassOf ¶
func ProviderFailureClassOf(err error) ProviderFailureClass
ProviderFailureClassOf returns a known typed class without inspecting error text.
type PublicKey ¶
type PublicKey struct {
// Algorithm records the algorithm the key material is intended to verify.
Algorithm Algorithm
// Material carries algorithm-specific public key material for later crypto slices.
Material any
// Metadata carries secret-safe provider classification facts.
Metadata KeyMetadata
}
PublicKey carries provider-owned public key material and bounded metadata.
type RecordedHop ¶
type RecordedHop struct {
// contains filtered or unexported fields
}
RecordedHop is one DKIM2 hop exactly as the message's header fields record it. Nothing in it is cryptographically verified: it is meaningful only for a message a trusted verifier already reported as PASS, whose chain result then covers every recorded field.
func DescribeRecordedChain ¶
func DescribeRecordedChain(message rawmsg.Message) ([]RecordedHop, error)
DescribeRecordedChain summarizes every DKIM2 hop recorded in message, ordered by sequence. It parses DKIM2-Signature, Message-Instance and Recipe fields with the verifier's extraction and collection rules under the default limits (a verifier configured with larger limits may pass a message this rejects), consults no key provider and verifies nothing. A Recipe is attributed only to the hop that introduced its Message-Instance, never to later relays; the VerifierProjection instead marks every signer of a Recipe-carrying instance as applied.
func (RecordedHop) Format ¶
func (RecordedHop) Format(state fmt.State, _ rune)
Format prevents formatting verbs from exposing message-derived facts.
func (RecordedHop) GoString ¶
func (RecordedHop) GoString() string
GoString returns a constant representation without message-derived facts.
func (RecordedHop) IntroducesInstance ¶
func (h RecordedHop) IntroducesInstance() bool
IntroducesInstance reports whether this hop is the first signer of its Message-Instance, that is the hop that produced the revision; later signers of the same instance relayed it.
func (RecordedHop) MessageInstance ¶
func (h RecordedHop) MessageInstance() uint64
MessageInstance returns the recorded Message-Instance number (m=) the hop signed.
func (RecordedHop) Recipe ¶
func (h RecordedHop) Recipe() recipe.Descriptor
Recipe returns the privacy-minimized descriptor of the recorded Recipe.
func (RecordedHop) RecipeMode ¶
func (h RecordedHop) RecipeMode() VerifierRecipeMode
RecipeMode returns applied when this hop recorded a Recipe for its revision, else unchanged.
func (RecordedHop) Sequence ¶
func (h RecordedHop) Sequence() uint64
Sequence returns the recorded signature sequence (i=).
func (RecordedHop) SignerDomain ¶
func (h RecordedHop) SignerDomain() string
SignerDomain returns the recorded canonical signer domain (d=).
func (RecordedHop) String ¶
func (RecordedHop) String() string
String returns a constant representation without message-derived facts.
func (RecordedHop) Valid ¶
func (h RecordedHop) Valid() bool
Valid reports whether the hop carries coherent recorded facts.
type ReplayProjection ¶
type ReplayProjection struct {
// contains filtered or unexported fields
}
ReplayProjection carries sealed aggregate-chain-PASS replay facts. The origin digest is the m=1 hash declaration identity: SHA-256 is preferred, so a SHA-512-only origin never groups with a mixed-algorithm origin.
func (ReplayProjection) Draft ¶
func (p ReplayProjection) Draft() string
Draft returns the exact bounded behavior baseline.
func (ReplayProjection) Exploded ¶
func (p ReplayProjection) Exploded() bool
Exploded returns the authenticated complete-chain OR fact.
func (ReplayProjection) Format ¶
func (ReplayProjection) Format(state fmt.State, _ rune)
Format prevents every formatting verb from exposing authenticated digest bytes.
func (ReplayProjection) GoString ¶
func (ReplayProjection) GoString() string
GoString returns a constant representation without authenticated digest bytes.
func (ReplayProjection) OriginReplayAlgorithm ¶
func (p ReplayProjection) OriginReplayAlgorithm() string
OriginReplayAlgorithm returns the frozen local equality algorithm.
func (ReplayProjection) OriginReplayDigest ¶
func (p ReplayProjection) OriginReplayDigest() ([32]byte, bool)
OriginReplayDigest returns the locally computed message-wide origin digest by value.
func (ReplayProjection) ReplayEligible ¶
func (p ReplayProjection) ReplayEligible() bool
ReplayEligible reports whether local replay policy applies. Draft-09 Section 15.1 concerns copies re-sent by an intermediary, so a message that carries only the originator's i=1 signature is not counted; the identity itself stays available for DSN propagation.
func (ReplayProjection) String ¶
func (ReplayProjection) String() string
String returns a constant representation without authenticated digest bytes.
func (ReplayProjection) Valid ¶
func (p ReplayProjection) Valid() bool
Valid reports whether the projection contains complete baseline facts.
type Request ¶
type Request struct {
// Message is the parser-owned RFC 5322 message.
Message rawmsg.Message
// Envelope carries current SMTP envelope evidence.
Envelope Envelope
// TargetSequence selects a DKIM2-Signature i= value when non-zero.
TargetSequence uint64
// RequireEnvelope records whether current-envelope matching is mandatory.
RequireEnvelope bool
// SkipEnvelopeForNonCurrentTarget explicitly disables envelope matching for diagnostic non-current targets.
SkipEnvelopeForNonCurrentTarget bool
// ReferenceTime replaces the verifier clock for the Section 10.4 timestamp
// window of the selected signature when non-zero. Callers set it when the
// signature is evaluated relative to another authenticated instant, such as
// an embedded original's completion signature judged against the outer
// DSN's t=; the zero value keeps the injected clock.
ReferenceTime time.Time
}
Request carries current-message verification input for later coordination.
type Result ¶
type Result struct {
// contains filtered or unexported fields
}
Result stores immutable bounded verification facts for service coordination.
func NewResult ¶
func NewResult(target Target, status TargetStatus, checks []CheckResult, signatureSets []SignatureSetResult) Result
NewResult constructs immutable verification result facts whose signature sets form one sig-all group, the layout of an s= value without "|".
func NewResultWithCustody ¶
func NewResultWithCustody(target Target, status TargetStatus, checks []CheckResult, signatureSets []SignatureSetResult, custody CustodyStatus) Result
NewResultWithCustody constructs immutable facts with established structural coverage.
func (Result) Checks ¶
func (r Result) Checks() []CheckResult
Checks returns immutable per-check facts.
func (Result) CustodyStatus ¶
func (r Result) CustodyStatus() CustodyStatus
CustodyStatus returns whole-sequence structural nd= coverage.
func (Result) GoString ¶
GoString returns a constant representation without private verification facts.
func (Result) ReplayProjection ¶
func (r Result) ReplayProjection() (ReplayProjection, bool)
ReplayProjection returns one independent sealed replay projection when present.
func (Result) SignatureLayout ¶
SignatureLayout returns the group layout of SignatureSets.
func (Result) SignatureSets ¶
func (r Result) SignatureSets() []SignatureSetResult
SignatureSets returns immutable per-signature-set facts.
func (Result) Status ¶
func (r Result) Status() TargetStatus
Status returns the overall target status.
func (Result) TargetFlagCandidate ¶
func (r Result) TargetFlagCandidate() (TargetFlagCandidate, bool)
TargetFlagCandidate returns the bounded parsed candidate by value when present.
type RevisionCustodyFacts ¶
type RevisionCustodyFacts struct {
// contains filtered or unexported fields
}
RevisionCustodyFacts stores the complete shared custody projection.
func (RevisionCustodyFacts) Format ¶
func (f RevisionCustodyFacts) Format(state fmt.State, _ rune)
Format routes every custody fact format through the redacted summary.
func (RevisionCustodyFacts) GoString ¶
func (f RevisionCustodyFacts) GoString() string
GoString returns a constant secret-safe custody fact Go representation.
func (RevisionCustodyFacts) HadNextDomain ¶
func (f RevisionCustodyFacts) HadNextDomain() bool
HadNextDomain reports whether any inherited hop used nd=.
func (RevisionCustodyFacts) Hops ¶
func (f RevisionCustodyFacts) Hops() []RevisionCustodyHopFact
Hops returns detached complete per-hop facts.
func (RevisionCustodyFacts) Status ¶
func (f RevisionCustodyFacts) Status() signature.CustodyStatus
Status returns the shared terminal custody status.
func (RevisionCustodyFacts) String ¶
func (f RevisionCustodyFacts) String() string
String returns a constant secret-safe custody fact summary.
func (RevisionCustodyFacts) Valid ¶
func (f RevisionCustodyFacts) Valid() bool
Valid reports whether custody facts are complete, contiguous, and passing.
type RevisionCustodyHopFact ¶
type RevisionCustodyHopFact struct {
// contains filtered or unexported fields
}
RevisionCustodyHopFact stores one bounded passing direct/link projection.
func (RevisionCustodyHopFact) Direct ¶
func (f RevisionCustodyHopFact) Direct() signature.CustodyDirectAlignmentStatus
Direct returns the shared d=/mf= status.
func (RevisionCustodyHopFact) Link ¶
func (f RevisionCustodyHopFact) Link() RevisionCustodyLinkStatus
Link returns the passing predecessor-link kind.
func (RevisionCustodyHopFact) Sequence ¶
func (f RevisionCustodyHopFact) Sequence() uint64
Sequence returns the inherited i= value.
type RevisionCustodyLinkStatus ¶
type RevisionCustodyLinkStatus string
RevisionCustodyLinkStatus identifies one already-passing custody link kind.
const ( // RevisionCustodyOrigin reports the first signature without a predecessor. RevisionCustodyOrigin RevisionCustodyLinkStatus = "origin" // RevisionCustodyOrdinaryToOrdinaryPass reports a passing Section 7 link. RevisionCustodyOrdinaryToOrdinaryPass RevisionCustodyLinkStatus = "ordinary_to_ordinary_pass" // RevisionCustodyOrdinaryToNextDomainPass reports a passing Section 12.3 authorization link. RevisionCustodyOrdinaryToNextDomainPass RevisionCustodyLinkStatus = "ordinary_to_next_domain_pass" // RevisionCustodyNextDomainToSignaturePass reports a passing nd= to d= link. RevisionCustodyNextDomainToSignaturePass RevisionCustodyLinkStatus = "next_domain_to_signature_pass" )
func (RevisionCustodyLinkStatus) Known ¶
func (s RevisionCustodyLinkStatus) Known() bool
Known reports whether status belongs to the closed passing-link vocabulary.
type RevisionEnvelopeState ¶
type RevisionEnvelopeState string
RevisionEnvelopeState identifies the already-proved current-envelope result.
const ( // RevisionEnvelopeOrdinaryPass reports passing current mf=/rt= comparison. RevisionEnvelopeOrdinaryPass RevisionEnvelopeState = "ordinary_pass" // RevisionEnvelopeTerminalNextDomainNotApplicable reports the terminal nd= exception. RevisionEnvelopeTerminalNextDomainNotApplicable RevisionEnvelopeState = "terminal_next_domain_not_applicable" )
func (RevisionEnvelopeState) Known ¶
func (s RevisionEnvelopeState) Known() bool
Known reports whether state belongs to the closed revision-envelope vocabulary.
type RevisionFacts ¶
type RevisionFacts struct {
// contains filtered or unexported fields
}
RevisionFacts stores immutable bounded all-hop facts without content or identities.
func (RevisionFacts) Custody ¶
func (f RevisionFacts) Custody() RevisionCustodyFacts
Custody returns detached complete custody facts.
func (RevisionFacts) Envelope ¶
func (f RevisionFacts) Envelope() RevisionEnvelopeState
Envelope returns the authenticated current-envelope result.
func (RevisionFacts) Flags ¶
func (f RevisionFacts) Flags() []RevisionFlagFacts
Flags returns detached authenticated flag facts in semantic sequence order.
func (RevisionFacts) Format ¶
func (f RevisionFacts) Format(state fmt.State, _ rune)
Format routes every facts format through the redacted summary.
func (RevisionFacts) GoString ¶
func (f RevisionFacts) GoString() string
GoString returns a constant secret-safe facts Go representation.
func (RevisionFacts) Hashes ¶
func (f RevisionFacts) Hashes() RevisionHashFacts
Hashes returns locally computed canonical SHA-256 facts after current hash verification passes.
func (RevisionFacts) HighestInstance ¶
func (f RevisionFacts) HighestInstance() uint64
HighestInstance returns the highest inherited m= value.
func (RevisionFacts) HighestSequence ¶
func (f RevisionFacts) HighestSequence() uint64
HighestSequence returns the highest inherited i= value.
func (RevisionFacts) History ¶
func (f RevisionFacts) History() RevisionHistoryFacts
History returns detached authenticated history facts.
func (RevisionFacts) HistoryHasUnavailableBody ¶
func (f RevisionFacts) HistoryHasUnavailableBody() bool
HistoryHasUnavailableBody reports whether explicit b:null created a historical proof gap.
func (RevisionFacts) InstanceCount ¶
func (f RevisionFacts) InstanceCount() int
InstanceCount returns the contiguous inherited instance count.
func (RevisionFacts) SignatureCount ¶
func (f RevisionFacts) SignatureCount() int
SignatureCount returns the contiguous inherited signature count.
func (RevisionFacts) Signatures ¶
func (f RevisionFacts) Signatures() []RevisionSignatureFact
Signatures returns detached per-signature proof facts.
func (RevisionFacts) String ¶
func (f RevisionFacts) String() string
String returns a constant secret-safe facts summary.
func (RevisionFacts) Timestamps ¶
func (f RevisionFacts) Timestamps() []uint64
Timestamps returns detached inherited t= values in semantic sequence order.
func (RevisionFacts) Usage ¶
func (f RevisionFacts) Usage() RevisionUsage
Usage returns aggregate all-hop proof work.
func (RevisionFacts) Valid ¶
func (f RevisionFacts) Valid() bool
Valid reports whether facts are complete and internally coherent.
type RevisionFlagFacts ¶
type RevisionFlagFacts struct {
// contains filtered or unexported fields
}
RevisionFlagFacts stores bounded authenticated policy facts for one inherited signature.
func (RevisionFlagFacts) Exploded ¶
func (f RevisionFlagFacts) Exploded() bool
Exploded reports authenticated exploded presence.
func (RevisionFlagFacts) FeedHere ¶
func (f RevisionFlagFacts) FeedHere() bool
FeedHere reports authenticated feedhere presence.
func (RevisionFlagFacts) Feedback ¶
func (f RevisionFlagFacts) Feedback() bool
Feedback reports authenticated feedback presence.
type RevisionHashFacts ¶
type RevisionHashFacts struct {
// contains filtered or unexported fields
}
RevisionHashFacts stores the verifier-local canonical SHA-256 projection.
func (RevisionHashFacts) BodyDigest ¶
func (f RevisionHashFacts) BodyDigest() [sha256DigestLength]byte
BodyDigest returns the locally computed canonical SHA-256 body digest.
func (RevisionHashFacts) Format ¶
func (f RevisionHashFacts) Format(state fmt.State, _ rune)
Format routes every hash fact format through the redacted summary.
func (RevisionHashFacts) GoString ¶
func (f RevisionHashFacts) GoString() string
GoString returns a constant secret-safe hash fact Go representation.
func (RevisionHashFacts) HeaderDigest ¶
func (f RevisionHashFacts) HeaderDigest() [sha256DigestLength]byte
HeaderDigest returns the locally computed canonical SHA-256 header digest.
func (RevisionHashFacts) Instance ¶
func (f RevisionHashFacts) Instance() uint64
Instance returns the selected current m= value.
func (RevisionHashFacts) String ¶
func (f RevisionHashFacts) String() string
String returns a constant secret-safe hash fact summary.
func (RevisionHashFacts) Valid ¶
func (f RevisionHashFacts) Valid() bool
Valid reports whether fixed SHA-256 pass facts name a current instance.
type RevisionHistoryFacts ¶
type RevisionHistoryFacts struct {
// contains filtered or unexported fields
}
RevisionHistoryFacts stores accepted history without reconstructed state.
func (RevisionHistoryFacts) Coverage ¶
func (f RevisionHistoryFacts) Coverage() HistoryCoverage
Coverage returns accepted historical coverage.
func (RevisionHistoryFacts) Format ¶
func (f RevisionHistoryFacts) Format(state fmt.State, _ rune)
Format routes every history fact format through the redacted summary.
func (RevisionHistoryFacts) GoString ¶
func (f RevisionHistoryFacts) GoString() string
GoString returns a constant secret-safe history fact Go representation.
func (RevisionHistoryFacts) HasUnavailableBody ¶
func (f RevisionHistoryFacts) HasUnavailableBody() bool
HasUnavailableBody reports the persistent explicit b:null gap.
func (RevisionHistoryFacts) Reached ¶
func (f RevisionHistoryFacts) Reached() uint64
Reached returns the earliest proved m= value.
func (RevisionHistoryFacts) Stop ¶
func (f RevisionHistoryFacts) Stop() HistoryStopReason
Stop returns the origin stop reason.
func (RevisionHistoryFacts) String ¶
func (f RevisionHistoryFacts) String() string
String returns a constant secret-safe history fact summary.
func (RevisionHistoryFacts) Target ¶
func (f RevisionHistoryFacts) Target() uint64
Target returns the highest historical m= value.
func (RevisionHistoryFacts) Transitions ¶
func (f RevisionHistoryFacts) Transitions() []RevisionHistoryTransitionFact
Transitions returns detached redacted adjacent facts.
func (RevisionHistoryFacts) Usage ¶
func (f RevisionHistoryFacts) Usage() HistoryUsage
Usage returns bounded authenticated history work.
func (RevisionHistoryFacts) Valid ¶
func (f RevisionHistoryFacts) Valid() bool
Valid reports whether every retained transition reached origin cleanly.
type RevisionHistoryTransitionFact ¶
type RevisionHistoryTransitionFact struct {
// contains filtered or unexported fields
}
RevisionHistoryTransitionFact stores one redacted adjacent proof.
func (RevisionHistoryTransitionFact) Body ¶
func (f RevisionHistoryTransitionFact) Body() HistoryDimensionState
Body returns the authenticated body state.
func (RevisionHistoryTransitionFact) From ¶
func (f RevisionHistoryTransitionFact) From() uint64
From returns the recipe-owning m= value.
func (RevisionHistoryTransitionFact) Header ¶
func (f RevisionHistoryTransitionFact) Header() HistoryDimensionState
Header returns the authenticated header state.
func (RevisionHistoryTransitionFact) Mode ¶
func (f RevisionHistoryTransitionFact) Mode() HistoryRecipeMode
Mode returns the applied recipe mode.
func (RevisionHistoryTransitionFact) To ¶
func (f RevisionHistoryTransitionFact) To() uint64
To returns the reconstructed adjacent m= value.
func (RevisionHistoryTransitionFact) Valid ¶
func (f RevisionHistoryTransitionFact) Valid() bool
Valid reports whether the transition contains only accepted proof states.
type RevisionInstant ¶
type RevisionInstant struct {
// contains filtered or unexported fields
}
RevisionInstant is one opaque, verifier-captured operation time.
Callers may copy this value between verification stages, but cannot initialize or alter its timestamp or policy binding.
func (RevisionInstant) Time ¶
func (i RevisionInstant) Time() time.Time
Time returns the exact immutable captured instant to trusted internal consumers.
func (RevisionInstant) UnixSeconds ¶
func (i RevisionInstant) UnixSeconds() uint64
UnixSeconds returns the exact nonnegative operation timestamp.
func (RevisionInstant) Valid ¶
func (i RevisionInstant) Valid() bool
Valid reports whether the instant was captured under the fixed revision policy.
func (RevisionInstant) WithinSkewOf ¶
func (i RevisionInstant) WithinSkewOf(reference RevisionInstant) bool
WithinSkewOf reports whether i was captured by the same verifier as reference and lies within the fixed five-minute operation skew of reference in either direction. The skew is independent of the Draft-09 signature timestamp windows. It lets a signing plan accept a caller-supplied instant, such as the one a report was rendered at, only when it is bounded by a fresh capture of the same clock.
type RevisionLimits ¶
type RevisionLimits struct {
// MaxProtocolFields bounds inherited Message-Instance and DKIM2-Signature fields.
MaxProtocolFields int
// MaxTotalSignatureSets bounds sets across all inherited signature fields.
MaxTotalSignatureSets int
// MaxPublicKeyLookups bounds supported inherited sets and provider calls.
MaxPublicKeyLookups int
// MaxCanonicalWorkBytes bounds aggregate Section 12.8 canonical input bytes.
MaxCanonicalWorkBytes int
// MaxSignatureInputBytes bounds one Section 12.8 canonical input.
MaxSignatureInputBytes int
// MaxDecodedRecipeBytes bounds each inherited decoded recipe.
MaxDecodedRecipeBytes int
}
RevisionLimits contains cumulative all-hop proof ceilings.
func DefaultRevisionLimits ¶
func DefaultRevisionLimits() RevisionLimits
DefaultRevisionLimits returns the signing-contract all-hop hard ceilings.
func (RevisionLimits) Validate ¶
func (l RevisionLimits) Validate() error
Validate rejects nonpositive or widened all-hop proof ceilings.
type RevisionProof ¶
type RevisionProof struct {
// contains filtered or unexported fields
}
RevisionProof is an opaque verify-owned capability input for signing-owned sealing.
func (RevisionProof) Draft ¶
func (p RevisionProof) Draft() string
Draft returns the bound protocol draft or an empty string for invalid proof.
func (RevisionProof) Facts ¶
func (p RevisionProof) Facts() RevisionFacts
Facts returns detached bounded all-hop facts.
func (RevisionProof) Format ¶
func (p RevisionProof) Format(state fmt.State, _ rune)
Format routes every proof formatting form through the redacted summary.
func (RevisionProof) GoString ¶
func (p RevisionProof) GoString() string
GoString returns a constant secret-safe proof Go representation.
func (RevisionProof) IsZero ¶
func (p RevisionProof) IsZero() bool
IsZero reports whether proof is the exact uninitialized zero value.
func (RevisionProof) ReplayProjection ¶
func (p RevisionProof) ReplayProjection() (ReplayProjection, bool)
ReplayProjection returns the sealed message-wide origin facts from complete proof.
func (RevisionProof) State ¶
func (p RevisionProof) State() RevisionProofOutcome
State returns the clean proof state or zero for invalid proof.
func (RevisionProof) String ¶
func (p RevisionProof) String() string
String returns a constant secret-safe proof summary.
func (RevisionProof) Valid ¶
func (p RevisionProof) Valid() bool
Valid reports whether proof is one of the two clean all-hop states.
func (RevisionProof) VerifierProjection ¶
func (p RevisionProof) VerifierProjection() (VerifierProjection, bool)
VerifierProjection returns sealed transport-neutral evidence only for ordinary complete proof.
type RevisionProofOutcome ¶
type RevisionProofOutcome string
RevisionProofOutcome identifies a closed all-hop verification result.
const ( // RevisionProofVerified reports complete ordinary all-hop proof. RevisionProofVerified RevisionProofOutcome = "verified" // RevisionProofTerminalNextDomainAuthorizationRequired reports clean proof ending in terminal nd=. RevisionProofTerminalNextDomainAuthorizationRequired RevisionProofOutcome = "terminal_next_domain_authorization_required" // RevisionProofProtocolRejected reports malformed, mismatched, expired, or otherwise failed protocol evidence. RevisionProofProtocolRejected RevisionProofOutcome = "protocol_rejected" // RevisionProofInvalidRecipeJSON reports authenticated r= text that is not // valid JSON or not a JSON object. RevisionProofInvalidRecipeJSON RevisionProofOutcome = "invalid_recipe_json" // RevisionProofInvalidRecipe reports valid authenticated r= JSON whose // schema, steps, or application are invalid (Draft-09 Section 14.2). RevisionProofInvalidRecipe RevisionProofOutcome = "invalid_recipe" // history that contains a null body Recipe, so the message is not a Fully // Verified DKIM2 Message (Draft-09 Section 13). RevisionProofBodyHistoryUnavailable RevisionProofOutcome = "body_history_unavailable" // RevisionProofHashMismatch reports a supported current or historical hash mismatch. RevisionProofHashMismatch RevisionProofOutcome = "hash_mismatch" // RevisionProofSignatureMismatch reports a supported inherited signature mismatch. RevisionProofSignatureMismatch RevisionProofOutcome = "signature_mismatch" // RevisionProofUnsupported reports an unsupported-only inherited signature field or hash tuple. RevisionProofUnsupported RevisionProofOutcome = "unsupported" // RevisionProofProviderTemporary reports retryable public-key provider failure. RevisionProofProviderTemporary RevisionProofOutcome = "provider_temporary" // RevisionProofProviderRejected reports a permanent public-key provider failure. RevisionProofProviderRejected RevisionProofOutcome = "provider_rejected" // RevisionProofMissingKey reports an inherited signature whose key is absent. RevisionProofMissingKey RevisionProofOutcome = "missing_key" // RevisionProofInvalidKey reports an inherited signature whose key is malformed or rejected. RevisionProofInvalidKey RevisionProofOutcome = "invalid_key" // RevisionProofRevokedKey reports an inherited signature whose key is revoked. RevisionProofRevokedKey RevisionProofOutcome = "revoked_key" // RevisionProofAmbiguousKey reports an inherited signature with ambiguous key records. RevisionProofAmbiguousKey RevisionProofOutcome = "ambiguous_key" // RevisionProofUnsupportedKeyType reports an inherited signature whose key type is unsupported. RevisionProofUnsupportedKeyType RevisionProofOutcome = "unsupported_key_type" // RevisionProofKeyAlgorithmMismatch reports an inherited signature whose key does not match its algorithm. RevisionProofKeyAlgorithmMismatch RevisionProofOutcome = "key_algorithm_mismatch" // RevisionProofProviderContract reports an inconsistent provider result/error pair. RevisionProofProviderContract RevisionProofOutcome = "provider_contract" // RevisionProofLimitExceeded reports bounded all-hop work exhaustion. RevisionProofLimitExceeded RevisionProofOutcome = "limit_exceeded" // RevisionProofFromNotAuthentic reports a From state of the authenticated // history that is not Authentic (Draft-09 Sections 11 and 14.8). RevisionProofFromNotAuthentic RevisionProofOutcome = "from_not_authentic" // RevisionProofFromSubdomainForbidden reports a From state that only the // upward match makes Authentic while the From domain's Domain Policy // Record carries the strict flag (Draft-09 Sections 3.8, 7.1 item 3, and // 14.8). RevisionProofFromSubdomainForbidden RevisionProofOutcome = "from_subdomain_forbidden" // RevisionProofDomainPolicyTemporary reports a Domain Policy Record that // could not be retrieved because of a temporary DNS failure (Section 3.8). RevisionProofDomainPolicyTemporary RevisionProofOutcome = "domain_policy_temporary" // RevisionProofDomainPolicyAmbiguous reports more than one Domain Policy // Record beginning with v=DKIM1 (Section 3.8). RevisionProofDomainPolicyAmbiguous RevisionProofOutcome = "domain_policy_ambiguous" // RevisionProofDomainPolicyInvalid reports an invalid Domain Policy Record // or a permanent lookup failure (local interpretation D1). RevisionProofDomainPolicyInvalid RevisionProofOutcome = "domain_policy_invalid" )
func (RevisionProofOutcome) Known ¶
func (o RevisionProofOutcome) Known() bool
Known reports whether outcome belongs to the closed revision proof vocabulary.
type RevisionProofRevalidation ¶
type RevisionProofRevalidation string
RevisionProofRevalidation identifies timestamp-only capability revalidation.
const ( // RevisionProofRevalidated reports that every inherited timestamp remains valid. RevisionProofRevalidated RevisionProofRevalidation = "revalidated" // RevisionProofTimestampInvalid reports that at least one inherited timestamp is no longer valid. RevisionProofTimestampInvalid RevisionProofRevalidation = "timestamp_invalid" )
func (RevisionProofRevalidation) Known ¶
func (s RevisionProofRevalidation) Known() bool
Known reports whether status belongs to the closed revalidation vocabulary.
type RevisionSetFact ¶
type RevisionSetFact struct {
// contains filtered or unexported fields
}
RevisionSetFact stores one source-indexed accepted signature-set fact.
func (RevisionSetFact) Algorithm ¶
func (f RevisionSetFact) Algorithm() Algorithm
Algorithm returns a known algorithm or the bounded unknown token.
func (RevisionSetFact) Format ¶
func (f RevisionSetFact) Format(state fmt.State, _ rune)
Format routes every set fact format through the redacted summary.
func (RevisionSetFact) GoString ¶
func (f RevisionSetFact) GoString() string
GoString returns a constant secret-safe set fact Go representation.
func (RevisionSetFact) Index ¶
func (f RevisionSetFact) Index() int
Index returns source order within the inherited field.
func (RevisionSetFact) LookedUp ¶
func (f RevisionSetFact) LookedUp() bool
LookedUp reports whether the set consumed a public-key lookup.
func (RevisionSetFact) State ¶
func (f RevisionSetFact) State() RevisionSetState
State returns the accepted set role.
func (RevisionSetFact) String ¶
func (f RevisionSetFact) String() string
String returns a constant secret-safe set fact summary.
func (RevisionSetFact) Valid ¶
func (f RevisionSetFact) Valid() bool
Valid reports whether the set fact is closed and coherent.
type RevisionSetState ¶
type RevisionSetState string
RevisionSetState identifies one inherited set's accepted proof role.
const ( // RevisionSetSupportedPass reports one known supported passing set. RevisionSetSupportedPass RevisionSetState = "supported_pass" // RevisionSetIgnoredUnknown reports one unknown-algorithm set in a field // that passed through another Draft-09 sig-all group. RevisionSetIgnoredUnknown RevisionSetState = "ignored_unknown" // RevisionSetAlternativeNotPassed reports one implemented-algorithm set // whose intermediate was not PASS (mismatch, key error, or locally // disabled) in a field that passed through another sig-all group. RevisionSetAlternativeNotPassed RevisionSetState = "alternative_not_passed" )
func (RevisionSetState) Known ¶
func (s RevisionSetState) Known() bool
Known reports whether state belongs to the closed accepted-set vocabulary.
type RevisionSignatureFact ¶
type RevisionSignatureFact struct {
// contains filtered or unexported fields
}
RevisionSignatureFact stores one complete inherited signature proof projection.
func (RevisionSignatureFact) Flags ¶
func (f RevisionSignatureFact) Flags() RevisionFlagFacts
Flags returns bounded authenticated policy flags.
func (RevisionSignatureFact) Format ¶
func (f RevisionSignatureFact) Format(state fmt.State, _ rune)
Format routes every signature fact format through the redacted summary.
func (RevisionSignatureFact) GoString ¶
func (f RevisionSignatureFact) GoString() string
GoString returns a constant secret-safe signature fact Go representation.
func (RevisionSignatureFact) Instance ¶
func (f RevisionSignatureFact) Instance() uint64
Instance returns the inherited m= reference.
func (RevisionSignatureFact) Sequence ¶
func (f RevisionSignatureFact) Sequence() uint64
Sequence returns the inherited i= value.
func (RevisionSignatureFact) Sets ¶
func (f RevisionSignatureFact) Sets() []RevisionSetFact
Sets returns detached source-ordered set facts.
func (RevisionSignatureFact) String ¶
func (f RevisionSignatureFact) String() string
String returns a constant secret-safe signature fact summary.
func (RevisionSignatureFact) Timestamp ¶
func (f RevisionSignatureFact) Timestamp() uint64
Timestamp returns the inherited t= seconds.
func (RevisionSignatureFact) Valid ¶
func (f RevisionSignatureFact) Valid() bool
Valid reports whether the signature fact has a supported pass and complete indexes.
type RevisionUsage ¶
type RevisionUsage struct {
// contains filtered or unexported fields
}
RevisionUsage stores aggregate all-hop proof work.
func (RevisionUsage) CanonicalBytes ¶
func (u RevisionUsage) CanonicalBytes() int
CanonicalBytes returns aggregate Section 6 and Section 12.8 input bytes.
func (RevisionUsage) CurrentCanonicalBytes ¶
func (u RevisionUsage) CurrentCanonicalBytes() int
CurrentCanonicalBytes returns current Section 6 hash input work.
func (RevisionUsage) DomainPolicyLookups ¶
func (u RevisionUsage) DomainPolicyLookups() int
DomainPolicyLookups returns the Draft-09 Section 3.8 Domain Policy Record lookups made for deduplicated upward From candidates.
func (RevisionUsage) Format ¶
func (u RevisionUsage) Format(state fmt.State, _ rune)
Format routes every usage format through the redacted summary.
func (RevisionUsage) GoString ¶
func (u RevisionUsage) GoString() string
GoString returns a constant secret-safe usage Go representation.
func (RevisionUsage) History ¶
func (u RevisionUsage) History() HistoryUsage
History returns bounded recipe/history usage.
func (RevisionUsage) KeyLookups ¶
func (u RevisionUsage) KeyLookups() int
KeyLookups returns supported-set lookup count.
func (RevisionUsage) ProtocolFields ¶
func (u RevisionUsage) ProtocolFields() int
ProtocolFields returns inherited protocol field count.
func (RevisionUsage) ProviderCalls ¶
func (u RevisionUsage) ProviderCalls() int
ProviderCalls returns actual provider callback count: key lookups plus Domain Policy Record lookups.
func (RevisionUsage) SignatureCanonicalBytes ¶
func (u RevisionUsage) SignatureCanonicalBytes() int
SignatureCanonicalBytes returns aggregate Section 12.8 input work.
func (RevisionUsage) SignatureSets ¶
func (u RevisionUsage) SignatureSets() int
SignatureSets returns inherited set count.
func (RevisionUsage) String ¶
func (u RevisionUsage) String() string
String returns a constant secret-safe usage summary.
func (RevisionUsage) Valid ¶
func (u RevisionUsage) Valid() bool
Valid reports whether aggregate counts are nonnegative and callback-exact.
type RunDescent ¶
type RunDescent struct {
// contains filtered or unexported fields
}
RunDescent is the immutable result of walking an already proven current state down to one floor instance while re-proving every intermediate state. Unlike a chain-verification walk it never emits a partial state: either the floor state was proven or nothing is exposed.
func (RunDescent) Degraded ¶
func (d RunDescent) Degraded() bool
Degraded reports whether body evidence was unavailable at any point of the descent: the initial state was headers-only, a transition carried a null or body-unavailable recipe, or the floor state carries no body. It stays true even when a later data-only recipe re-materialized a body, because that body was never observed by the system that received the message.
func (RunDescent) Failure ¶
func (d RunDescent) Failure() RunDescentFailure
Failure returns the closed reason when the descent was not reconstructable.
func (RunDescent) Format ¶
func (d RunDescent) Format(state fmt.State, _ rune)
Format routes every descent formatting form through the redacted summary.
func (RunDescent) GoString ¶
func (d RunDescent) GoString() string
GoString returns the constant secret-safe descent Go representation.
func (RunDescent) Outcome ¶
func (d RunDescent) Outcome() RunDescentOutcome
Outcome returns the closed descent outcome.
func (RunDescent) ReachedInstance ¶
func (d RunDescent) ReachedInstance() uint64
ReachedInstance returns the floor instance reached by a reconstructed descent or zero.
func (RunDescent) RewrittenHeaderNames ¶
func (d RunDescent) RewrittenHeaderNames() []string
RewrittenHeaderNames returns the sorted, deduplicated canonical header names that any recipe applied during a reconstructed descent rewrote. The applier regroups exactly these names; every other name passed through in its source order. It is nil for a non-reconstructable descent.
func (RunDescent) State ¶
func (d RunDescent) State() (recipe.State, bool)
State returns the proven floor state and false for a non-reconstructable descent.
func (RunDescent) String ¶
func (RunDescent) String() string
String returns a constant secret-safe descent summary.
func (RunDescent) Valid ¶
func (d RunDescent) Valid() bool
Valid reports whether the descent was produced by a coordinator and is coherent.
type RunDescentFailure ¶
type RunDescentFailure string
RunDescentFailure is the closed reason a descent was not reconstructable.
const ( // RunDescentRecipeInvalid reports malformed authenticated recipe JSON. RunDescentRecipeInvalid RunDescentFailure = "recipe_invalid" // RunDescentApplicationInvalid reports a recipe that cannot be applied to its state. RunDescentApplicationInvalid RunDescentFailure = "application_invalid" RunDescentSourceUnavailable RunDescentFailure = "source_unavailable" // RunDescentLimitExceeded reports a transition, cumulative, or canonical ceiling. RunDescentLimitExceeded RunDescentFailure = "limit_exceeded" // RunDescentHashMismatch reports a reconstructed state whose supported digest differs. RunDescentHashMismatch RunDescentFailure = "hash_mismatch" // RunDescentUnsupportedHash reports an instance without any supported hash tuple. RunDescentUnsupportedHash RunDescentFailure = "unsupported_hash" // RunDescentInternalContract reports an impossible internal state. RunDescentInternalContract RunDescentFailure = "internal_contract" )
func (RunDescentFailure) Known ¶
func (f RunDescentFailure) Known() bool
Known reports whether the failure belongs to the closed vocabulary.
type RunDescentOutcome ¶
type RunDescentOutcome string
RunDescentOutcome is the closed result of one floor-bounded descent.
const ( // RunDescentReconstructed reports a proven state at the requested floor instance. RunDescentReconstructed RunDescentOutcome = "reconstructed" // RunDescentNotReconstructable reports that the descent could not prove the floor state. RunDescentNotReconstructable RunDescentOutcome = "not_reconstructable" )
func (RunDescentOutcome) Known ¶
func (o RunDescentOutcome) Known() bool
Known reports whether the outcome belongs to the closed vocabulary.
type RunMemberOutcome ¶
type RunMemberOutcome string
RunMemberOutcome is the closed result of verifying embedded run members.
const ( // RunMemberVerified reports that every requested signature verified cryptographically. RunMemberVerified RunMemberOutcome = "verified" // RunMemberUnverified reports at least one requested signature that did not verify. RunMemberUnverified RunMemberOutcome = "unverified" // RunMemberTemporary reports a typed temporary key-provider failure before a permanent answer. RunMemberTemporary RunMemberOutcome = "temporary" )
func (RunMemberOutcome) Known ¶
func (o RunMemberOutcome) Known() bool
Known reports whether the outcome belongs to the closed vocabulary.
type SignatureSetResult ¶
type SignatureSetResult struct {
// Index records the zero-based s= set position.
Index int
// Selector is the parsed, DNS-label-validated selector of the set, so a
// non-passing set can be named (Draft-09 Section 14.6 step 8).
Selector string
// Algorithm records the signature algorithm name.
Algorithm Algorithm
// Status records the per-signature-set outcome.
Status SignatureSetStatus
// KeyStatus records associated key lookup and validation state.
KeyStatus KeyStatus
}
SignatureSetResult records bounded facts for one signature set.
func SignatureSetAt ¶
func SignatureSetAt(sets []SignatureSetResult, index int) (SignatureSetResult, bool)
SignatureSetAt returns the set with the given field-order Index, the lookup for a combination outcome's decisive set.
type SignatureSetStatus ¶
type SignatureSetStatus string
SignatureSetStatus records one s= selector:algorithm:signature outcome.
const ( // SignatureSetStatusNotChecked records a signature set not yet evaluated. SignatureSetStatusNotChecked SignatureSetStatus = "not_checked" // SignatureSetStatusPass records a cryptographic pass for one signature set. SignatureSetStatusPass SignatureSetStatus = "pass" // SignatureSetStatusFail records a cryptographic failure for one signature set. SignatureSetStatusFail SignatureSetStatus = "fail" // SignatureSetStatusUnsupportedAlgorithm records a known non-success unsupported algorithm. SignatureSetStatusUnsupportedAlgorithm SignatureSetStatus = "unsupported_algorithm" // SignatureSetStatusDisabledAlgorithm records an algorithm disabled by local policy. SignatureSetStatusDisabledAlgorithm SignatureSetStatus = "disabled_algorithm" // SignatureSetStatusMissingKey records a missing public key. SignatureSetStatusMissingKey SignatureSetStatus = "missing_key" // SignatureSetStatusInvalidKey records public key material rejected before crypto use. SignatureSetStatusInvalidKey SignatureSetStatus = "invalid_key" // SignatureSetStatusAmbiguousKey records multiple matching public keys. SignatureSetStatusAmbiguousKey SignatureSetStatus = "ambiguous_key" // SignatureSetStatusRevokedKey records an explicitly revoked DNS public key. SignatureSetStatusRevokedKey SignatureSetStatus = "revoked_key" // SignatureSetStatusUnsupportedKeyType records an unsupported DNS key type. SignatureSetStatusUnsupportedKeyType SignatureSetStatus = "unsupported_key_type" // SignatureSetStatusKeyAlgorithmMismatch records DNS key type disagreement with the requested algorithm. SignatureSetStatusKeyAlgorithmMismatch SignatureSetStatus = "key_algorithm_mismatch" // SignatureSetStatusWrongKeyType records a public key type mismatch. SignatureSetStatusWrongKeyType SignatureSetStatus = "wrong_key_type" // SignatureSetStatusKeyPolicyRejected records a key rejected by verifier policy. SignatureSetStatusKeyPolicyRejected SignatureSetStatus = "key_policy_rejected" // SignatureSetStatusProviderError records a bounded key-provider failure. SignatureSetStatusProviderError SignatureSetStatus = "provider_error" // SignatureSetStatusProviderTemporary records typed retryable provider failure. SignatureSetStatusProviderTemporary SignatureSetStatus = "provider_temporary" // SignatureSetStatusProviderPermanent records typed unrecoverable provider failure. SignatureSetStatusProviderPermanent SignatureSetStatus = "provider_permanent" // SignatureSetStatusProviderContract records inconsistent provider behavior. SignatureSetStatusProviderContract SignatureSetStatus = "provider_contract" )
func (SignatureSetStatus) Known ¶
func (s SignatureSetStatus) Known() bool
Known reports whether status is part of the per-signature-set vocabulary.
type StaticKey ¶
type StaticKey struct {
// Domain is the canonical d= signing domain.
Domain string
// Selector is the canonical s= selector.
Selector string
// Algorithm is the canonical signature algorithm.
Algorithm Algorithm
// Material is the algorithm-specific public key value.
Material any
// Metadata carries bounded provider facts without key bytes.
Metadata KeyMetadata
}
StaticKey describes one deterministic in-memory public verification key.
type StaticKeyProvider ¶
type StaticKeyProvider struct {
// contains filtered or unexported fields
}
StaticKeyProvider resolves public keys from deterministic in-memory tuples.
func NewStaticKeyProvider ¶
func NewStaticKeyProvider(keys []StaticKey, options ...StaticKeyProviderOption) (StaticKeyProvider, error)
NewStaticKeyProvider constructs a deterministic static public-key provider.
type StaticKeyProviderOption ¶
type StaticKeyProviderOption func(*staticKeyProviderConfig)
StaticKeyProviderOption mutates static provider construction settings.
func WithStaticKeyAlgorithmPolicy ¶
func WithStaticKeyAlgorithmPolicy(policy AlgorithmPolicy) StaticKeyProviderOption
WithStaticKeyAlgorithmPolicy replaces static provider key-validation policy.
type Target ¶
type Target struct {
// Sequence records the selected i= DKIM2-Signature value.
Sequence uint64
// InstanceNumber records the selected m= Message-Instance value.
InstanceNumber uint64
}
Target identifies the selected DKIM2 signature and instance numbers.
type TargetFlagCandidate ¶
type TargetFlagCandidate struct {
// contains filtered or unexported fields
}
TargetFlagCandidate stores bounded parser-owned evidence for the selected target.
func (TargetFlagCandidate) Exploded ¶
func (c TargetFlagCandidate) Exploded() bool
Exploded reports whether parsed target flags contain exploded.
func (TargetFlagCandidate) FeedHere ¶
func (c TargetFlagCandidate) FeedHere() bool
FeedHere reports whether parsed target flags contain feedhere.
func (TargetFlagCandidate) Feedback ¶
func (c TargetFlagCandidate) Feedback() bool
Feedback reports whether parsed target flags contain feedback.
func (TargetFlagCandidate) Sequence ¶
func (c TargetFlagCandidate) Sequence() uint64
Sequence returns the parsed target signature sequence.
func (TargetFlagCandidate) Valid ¶
func (c TargetFlagCandidate) Valid() bool
Valid reports whether the candidate identifies a positive target sequence.
type TargetStatus ¶
type TargetStatus string
TargetStatus records the overall target verification state.
const ( // TargetStatusNotEvaluated records a target that has not run. TargetStatusNotEvaluated TargetStatus = "not_evaluated" // TargetStatusPass records target success for evaluated checks. TargetStatusPass TargetStatus = "pass" // TargetStatusFail records target failure. TargetStatusFail TargetStatus = "fail" // TargetStatusMixed records mixed per-signature-set outcomes. TargetStatusMixed TargetStatus = "mixed" // TargetStatusUnsupported records no checkable supported path. TargetStatusUnsupported TargetStatus = "unsupported" // TargetStatusIndeterminate records bounded non-success ambiguity. TargetStatusIndeterminate TargetStatus = "indeterminate" // TargetStatusUnknown records an unrecognized internal status without retaining its spelling. TargetStatusUnknown TargetStatus = "unknown" )
func (TargetStatus) Known ¶
func (s TargetStatus) Known() bool
Known reports whether status is part of the overall target vocabulary.
type TimestampStatus ¶
type TimestampStatus string
TimestampStatus records local t= policy state.
const ( // TimestampStatusNotChecked records a timestamp check that has not run. TimestampStatusNotChecked TimestampStatus = "not_checked" // TimestampStatusPass records an accepted timestamp. TimestampStatusPass TimestampStatus = "pass" // TimestampStatusFuture records a timestamp beyond future tolerance. TimestampStatusFuture TimestampStatus = "future" // TimestampStatusExpired records a timestamp older than maximum age. TimestampStatusExpired TimestampStatus = "expired" // TimestampStatusNotApplicable records a timestamp check outside the target semantics. TimestampStatusNotApplicable TimestampStatus = "not_applicable" // TimestampStatusInvalid records malformed parser-owned timestamp state. TimestampStatusInvalid TimestampStatus = "invalid" )
func (TimestampStatus) Known ¶
func (s TimestampStatus) Known() bool
Known reports whether status is part of the timestamp-status vocabulary.
type Verifier ¶
type Verifier struct {
// contains filtered or unexported fields
}
Verifier owns validated verification dependencies and policies.
func NewVerifier ¶
func NewVerifier(provider KeyProvider, options ...Option) (Verifier, error)
NewVerifier constructs a verifier with validated dependencies and policies. The options must carry an explicit Section 11.1 choice through WithFromAuthorization; construction fails closed without one.
func (Verifier) CaptureRevisionInstant ¶
func (v Verifier) CaptureRevisionInstant() (RevisionInstant, error)
CaptureRevisionInstant captures one representable nonnegative operation time.
func (Verifier) DeliveryReference ¶
DeliveryReference returns arrival as the Section 14.3 reference instant for a message that a local MTA reports on after delivery, for example in a DSN generated when the queue lifetime expired. The reported instant is used only when it lies within [clock-signatureMaxAge, clock+revisionInstantSkew]; an absent or out-of-range instant reports false so callers keep the verifier clock, which is never more permissive for the maximum-age limit.
func (Verifier) DescendEmbeddedRun ¶
func (v Verifier) DescendEmbeddedRun(ctx context.Context, embedded EmbeddedInput, initial recipe.State, floor uint64) (RunDescent, error)
DescendEmbeddedRun descends an already verified embedded original from its proven current state to the floor instance referenced by the previous hop signature. The initial state may be headers-only when the original was embedded as text/rfc822-headers. It reuses the verifier's history coordinator under the verifier's all-hop canonical work ceiling and never changes chain-verification semantics.
func (Verifier) ExecutePreparedRevisionProof ¶
func (v Verifier) ExecutePreparedRevisionProof(ctx context.Context, prepared PreparedRevisionProof) (RevisionProofOutcome, RevisionProof, error)
ExecutePreparedRevisionProof performs only fixed-order provider lookup and signature verification.
func (Verifier) ExtractEmbeddedInput ¶
func (v Verifier) ExtractEmbeddedInput(message rawmsg.Message) (EmbeddedInput, error)
ExtractEmbeddedInput parses the protocol fields of an embedded original once under the verifier's own instance, signature, and recipe limits.
func (Verifier) KeyProvider ¶
func (v Verifier) KeyProvider() KeyProvider
KeyProvider returns the injected static key provider boundary.
func (Verifier) PrepareRevisionProofAt ¶
func (v Verifier) PrepareRevisionProofAt(ctx context.Context, request Request, instant RevisionInstant) (RevisionProofOutcome, PreparedRevisionProof, error)
PrepareRevisionProofAt performs all provider-free revision work at one operation instant.
func (Verifier) RevalidateRevisionProof ¶
func (v Verifier) RevalidateRevisionProof(ctx context.Context, proof RevisionProof) (RevisionProofRevalidation, error)
RevalidateRevisionProof rechecks every inherited timestamp against one newly captured clock.
func (Verifier) RevalidateRevisionProofAt ¶
func (v Verifier) RevalidateRevisionProofAt(ctx context.Context, proof RevisionProof, instant RevisionInstant) (RevisionProofRevalidation, error)
RevalidateRevisionProofAt rechecks inherited timestamps at one verifier-owned instant.
func (Verifier) Verify ¶
Verify extracts DKIM2 fields from a raw message and verifies the selected target.
func (Verifier) VerifyCurrent ¶
VerifyCurrent verifies authoritative current facts without reconstructing authenticated history.
func (Verifier) VerifyDeliveryStatusComplete ¶
func (v Verifier) VerifyDeliveryStatusComplete(ctx context.Context, request Request) (Result, error)
VerifyDeliveryStatusComplete verifies a complete embedded DSN original without fabricating an observed SMTP envelope for the embedded object. The dedicated DSN caller must separately bind authenticated mf= and rt= claims to the outer report and delivery-status fields.
func (Verifier) VerifyDeliveryStatusHeadersOnly ¶
func (v Verifier) VerifyDeliveryStatusHeadersOnly(ctx context.Context, request Request) (HeaderEvidence, error)
VerifyDeliveryStatusHeadersOnly verifies the restricted evidence carried by a DSN text/rfc822-headers original. It requires RFC 5322 header-only framing, validates the highest DKIM2 target header hash, Section 12.8 signature, timestamp, and custody structure without inventing current-envelope evidence, and never evaluates or substitutes body evidence.
func (Verifier) VerifyEmbeddedSignatures ¶
func (v Verifier) VerifyEmbeddedSignatures(ctx context.Context, embedded EmbeddedInput, sequences []uint64) (RunMemberOutcome, error)
VerifyEmbeddedSignatures verifies the named non-highest DKIM2-Signature sequences of an already extracted embedded original over the Section 12.8 fields they cover. The fields are present in the embedded original as is, so no historical reconstruction is needed. It applies the same bounded key lookup order and set semantics as the all-hop revision proof and does not evaluate timestamps or envelopes: run members are the local system's own signatures whose cryptographic integrity is the only fact this seam establishes.
func (Verifier) VerifyHistoricalTarget ¶
func (v Verifier) VerifyHistoricalTarget(ctx context.Context, embedded EmbeddedInput, request HistoricalTargetRequest) (HistoricalTargetOutcome, error)
VerifyHistoricalTarget verifies the non-highest DKIM2-Signature selected by request.Sequence over the reconstructed state at its instance. It re-proves the state's header hash, and its body hash when known, against that instance, computes the Section 12.8 input over the state's header block, evaluates the signature sets with the current-target crypto and key provider, evaluates the Section 10.4 window at the request reference instant with the additional bound that t= must not exceed MaxTimestamp, and applies the Section 14.4 relaxed d=/mf= match through the shared custody rules of the chain as it existed when the target signed. Custody is validated over the whole chain below and including the target, exactly as the current-target verifier validates the chain below its target; a broken link there is the distinct custody_rejected outcome, while a failed d=/mf= match of the target itself is alignment_rejected. A null mf= is reported as its own outcome so the caller can forbid propagation. An nd= target is not a supported historical target and is a request error.
func (Verifier) VerifyRevisionProof ¶
func (v Verifier) VerifyRevisionProof(ctx context.Context, request Request) (RevisionProofOutcome, RevisionProof, error)
VerifyRevisionProof verifies every inherited signature and all authenticated history without using Result.
func (Verifier) VerifyRevisionProofAfterCurrent ¶
func (v Verifier) VerifyRevisionProofAfterCurrent(ctx context.Context, request Request, current Result) (RevisionProofOutcome, RevisionProof, error)
VerifyRevisionProofAfterCurrent completes all-hop proof without repeating the already verified current key lookup.
func (Verifier) VerifyRevisionProofAt ¶
func (v Verifier) VerifyRevisionProofAt(ctx context.Context, request Request, instant RevisionInstant) (RevisionProofOutcome, RevisionProof, error)
VerifyRevisionProofAt verifies inherited proof at one verifier-owned instant.
type VerifierCustodyTransition ¶
type VerifierCustodyTransition string
VerifierCustodyTransition identifies one authenticated hop's chain role.
const ( // VerifierCustodyOrigin identifies the first authenticated signature. VerifierCustodyOrigin VerifierCustodyTransition = "origin" // VerifierCustodyOrdinary identifies an ordinary adjacent custody link. VerifierCustodyOrdinary VerifierCustodyTransition = "ordinary" // VerifierCustodyNextDomain identifies a link involving authenticated nd= custody. VerifierCustodyNextDomain VerifierCustodyTransition = "next_domain" // VerifierCustodyTerminalNextDomain identifies an unresolved terminal nd= claim. VerifierCustodyTerminalNextDomain VerifierCustodyTransition = "terminal_next_domain" )
func (VerifierCustodyTransition) Known ¶
func (t VerifierCustodyTransition) Known() bool
Known reports whether the transition belongs to the closed projection vocabulary.
type VerifierHop ¶
type VerifierHop struct {
// contains filtered or unexported fields
}
VerifierHop stores one immutable authenticated chain record.
func (VerifierHop) BodyAvailability ¶
func (h VerifierHop) BodyAvailability() recipe.BodyAvailability
BodyAvailability returns whether authenticated historical body bytes were available.
func (VerifierHop) CustodyTransition ¶
func (h VerifierHop) CustodyTransition() VerifierCustodyTransition
CustodyTransition returns the authenticated closed custody role.
func (VerifierHop) Flags ¶
func (h VerifierHop) Flags() RevisionFlagFacts
Flags returns authenticated policy flags by value.
func (VerifierHop) Format ¶
func (VerifierHop) Format(state fmt.State, _ rune)
Format prevents formatting verbs from exposing message-derived facts.
func (VerifierHop) GoString ¶
func (VerifierHop) GoString() string
GoString returns a constant representation without message-derived facts.
func (VerifierHop) HistoryBodyState ¶
func (h VerifierHop) HistoryBodyState() HistoryDimensionState
HistoryBodyState returns authenticated historical body comparison state.
func (VerifierHop) HistoryHeaderState ¶
func (h VerifierHop) HistoryHeaderState() HistoryDimensionState
HistoryHeaderState returns authenticated historical header comparison state.
func (VerifierHop) HopBinding ¶
func (h VerifierHop) HopBinding() [sha256.Size]byte
HopBinding returns the deterministic SHA-256 binding for this record.
func (VerifierHop) MessageInstance ¶
func (h VerifierHop) MessageInstance() uint64
MessageInstance returns the authenticated Message-Instance number.
func (VerifierHop) Recipe ¶
func (h VerifierHop) Recipe() recipe.Descriptor
Recipe returns the immutable privacy-minimized Recipe descriptor.
func (VerifierHop) RecipeMode ¶
func (h VerifierHop) RecipeMode() VerifierRecipeMode
RecipeMode returns whether the transition used a Recipe.
func (VerifierHop) Sequence ¶
func (h VerifierHop) Sequence() uint64
Sequence returns the authenticated signature sequence.
func (VerifierHop) SignatureAlgorithms ¶
func (h VerifierHop) SignatureAlgorithms() []Algorithm
SignatureAlgorithms returns sorted unique successfully verified algorithms.
func (VerifierHop) SignerDomain ¶
func (h VerifierHop) SignerDomain() string
SignerDomain returns the canonical verified signing domain.
func (VerifierHop) String ¶
func (VerifierHop) String() string
String returns a constant representation without message-derived facts.
func (VerifierHop) Valid ¶
func (h VerifierHop) Valid() bool
Valid reports whether the hop is complete, bounded, and binding-coherent.
type VerifierProjection ¶
type VerifierProjection struct {
// contains filtered or unexported fields
}
VerifierProjection stores one sealed complete-chain policy evidence projection.
func (VerifierProjection) Binding ¶
func (p VerifierProjection) Binding() [sha256.Size]byte
Binding returns the complete projection SHA-256 binding.
func (VerifierProjection) Draft ¶
func (p VerifierProjection) Draft() string
Draft returns the exact protocol baseline.
func (VerifierProjection) Format ¶
func (VerifierProjection) Format(state fmt.State, _ rune)
Format prevents formatting verbs from exposing message-derived facts.
func (VerifierProjection) GoString ¶
func (VerifierProjection) GoString() string
GoString returns a constant representation without message-derived facts.
func (VerifierProjection) Hops ¶
func (p VerifierProjection) Hops() []VerifierHop
Hops returns detached ordered chain records.
func (VerifierProjection) Schema ¶
func (p VerifierProjection) Schema() string
Schema returns the exact stable projection identity.
func (VerifierProjection) String ¶
func (VerifierProjection) String() string
String returns a constant representation without message-derived facts.
func (VerifierProjection) Valid ¶
func (p VerifierProjection) Valid() bool
Valid reports whether the projection is complete, contiguous, and binding-coherent.
type VerifierRecipeMode ¶
type VerifierRecipeMode string
VerifierRecipeMode identifies whether one authenticated transition used a Recipe.
const ( // VerifierRecipeUnchanged reports an absent Recipe and unchanged state. VerifierRecipeUnchanged VerifierRecipeMode = "unchanged" // VerifierRecipeApplied reports a parsed and authenticated Recipe transition. VerifierRecipeApplied VerifierRecipeMode = "applied" )
func (VerifierRecipeMode) Known ¶
func (m VerifierRecipeMode) Known() bool
Known reports whether the mode belongs to the closed projection vocabulary.
Source Files
¶
- algorithms.go
- applicability.go
- combine.go
- crypto.go
- delivery_status_headers.go
- doc.go
- domain_alignment.go
- domain_policy.go
- embedded_input.go
- envelope.go
- errors.go
- from_authenticity.go
- hash.go
- historical_target.go
- history.go
- keys.go
- local_hop_run.go
- next_domain.go
- options.go
- provider_failure.go
- recorded_chain.go
- replay_projection.go
- result.go
- revision.go
- revision_facts.go
- run_descent.go
- run_member.go
- timestamp.go
- types.go
- verifier.go
- verifier_projection.go