Documentation ¶
Index ¶
- Variables
- func WithLookupTXTFunc(ctx context.Context, lookupTXT lookupTXTFunc) context.Context
- func WithMaxHeaders(ctx context.Context, maxHeaders int) context.Context
- func WithTraceFunc(ctx context.Context, trace TraceFunc) context.Context
- type EvaluationState
- type OneResult
- type Signer
- type TraceFunc
- type VerifyResult
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrBodyHashMismatch = errors.New("body hash mismatch") ErrVerificationFailed = errors.New("verification failed") )
These two errors are returned when the verification fails, but the header is considered valid.
Functions ¶
func WithLookupTXTFunc ¶
Types ¶
type EvaluationState ¶
type EvaluationState string
Evaluation states, as per https://datatracker.ietf.org/doc/html/rfc6376#section-3.9.
const ( SUCCESS EvaluationState = "SUCCESS" PERMFAIL EvaluationState = "PERMFAIL" TEMPFAIL EvaluationState = "TEMPFAIL" )
type OneResult ¶
type OneResult struct { // The raw signature header. SignatureHeader string // Domain and selector from the signature header. Domain string Selector string // Base64-encoded signature. May be missing if it is not present in the // header. B string // The result of the evaluation. State EvaluationState Error error }
type Signer ¶
type VerifyResult ¶
type VerifyResult struct { // How many signatures were found. Found uint // How many signatures were verified successfully. Valid uint // The details for each signature that was found. Results []*OneResult }
func VerifyMessage ¶
func VerifyMessage(ctx context.Context, message string) (*VerifyResult, error)
func (*VerifyResult) AuthenticationResults ¶
func (r *VerifyResult) AuthenticationResults() string
Returns the DKIM-specific contents for an Authentication-Results header. It is just the contents, the header needs to still be constructed. Note that the output will need to be indented by the caller. https://datatracker.ietf.org/doc/html/rfc8601#section-2.7.1
Click to show internal directories.
Click to hide internal directories.