Versions in this module Expand all Collapse all v0 v0.1.1 Jan 10, 2023 v0.1.0 Jan 10, 2023 Changes in this version + var ErrAMSIncludesSealHeader = errors.New("Arc-Message-signature MUST NOT sign ARC-Seal") + var ErrAMSValidationFailure = errors.New("most recent ARC-Message-signature did not validate") + var ErrArcLimit = errors.New("message over arc-set limit") + var ErrBadSignature = errors.New("bad signature") + var ErrBodyHashMismatched = errors.New("body hash mismatched") + var ErrDomainMismatch = errors.New("domain mismatch") + var ErrInputError = errors.New("input error") + var ErrInstanceMismatch = errors.New("mismatch of arc header instances") + var ErrInvalidSigningEntity = errors.New("invalid signing entity") + var ErrKeyRevoked = errors.New("key revoked") + var ErrKeyUnavailable = errors.New("key unavailable") + var ErrMissingArcFields = errors.New("missing arc fields") + var ErrMsgNotSigned = errors.New("message is not arc signed") + var ErrSignatureExpired = errors.New("signature expired") + var ErrSignatureNotFound = errors.New("signature not found") + var ErrTestingMode = errors.New("domain is testing DKIM") + var ErrTimestampInFuture = errors.New("timestamp in the future") + var ErrUnacceptableKey = errors.New("unacceptable key") + var Queries = map[string]PublicKeyQuery + func CanonicalMIMEHeaderKey(s string) string + type AlgorithmID crypto.Hash + func (id AlgorithmID) MarshalText() ([]byte, error) + type ArcResult struct + Chain []ArcSetResult + func VerifyArc(msg *Message) (*ArcResult, error) + type ArcSetResult struct + AMSValid bool + ASValid bool + CV ResultCode + Dkim ResultCode + Dmarc ResultCode + Instance int + Spf ResultCode + type ErrorSource uint8 + const KeyError + const SignatureError + const VerifyError + type KVPair struct + Folded string + Key string + Original string + type MIMEHeader map[string][]KVPair + func (h MIMEHeader) CanonicalizedAndFolded() map[string][]string + type Message struct + Body io.ReadSeeker + Header MIMEHeader + func ParseMessage(s string) (*Message, error) + type PublicKey struct + Algorithms []string + Data []byte + Flags []string + KeyType string + Notes string + Raw string + Services []string + Strict bool + Testing bool + Version string + type PublicKeyQuery func(*Signature) (*PublicKey, error) + type Reader struct + R *bufio.Reader + func NewReader(r *bufio.Reader) *Reader + func (r *Reader) ReadLineBytes() ([]byte, error) + func (r *Reader) ReadMIMEHeader() (MIMEHeader, error) + type Result struct + Error *VerificationError + Key *PublicKey + Order int + Result ResultCode + Signature *Signature + Timestamp time.Time + func Verify(hdr string, msg *Message, opts ...VerifyOption) ([]*Result, error) + func (r *Result) String() string + type ResultCode uint8 + const Fail + const Neutral + const None + const Pass + const Permerror + const Policy + const Temperror + func (r ResultCode) MarshalText() ([]byte, error) + func (r ResultCode) String() string + type Signature struct + AlgorithmID AlgorithmID + ArcCV ResultCode + ArcInstance int + BodyHash []byte + CopiedHeaders map[string]string + Dkim ResultCode + Dmarc ResultCode + Expiration time.Time + Hash []byte + Header string + Headers []string + Length int64 + Raw string + RelaxedBody bool + RelaxedHeader bool + Selector string + SignerDomain string + Spf ResultCode + Timestamp time.Time + UserIdentifier string + type VerificationError struct + Err error + Explanation string + Source ErrorSource + Tag string + Value string + func (e *VerificationError) Error() string + func (e *VerificationError) MarshalJSON() ([]byte, error) + type VerifyOption func(s *Signature, k *PublicKey, m *Message) (ResultCode, error) + func InvalidSigningEntityOption(domains ...string) VerifyOption + func SignatureTimingOption(drift time.Duration) VerifyOption