dkim

package
v0.0.0-...-a0901ff Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2015 License: GPL-3.0 Imports: 14 Imported by: 0

README

DKIM signing for Go

You can find the package docs here

Documentation

Index

Constants

View Source
const (
	VersionKey          = "v"
	AlgorithmKey        = "a"
	DomainKey           = "d"
	SelectorKey         = "s"
	CanonicalizationKey = "c"
	QueryMethodKey      = "q"
	BodyLengthKey       = "l"
	TimestampKey        = "t"
	ExpireKey           = "x"
	FieldsKey           = "h"
	BodyHashKey         = "bh"
	SignatureDataKey    = "b"
	AUIDKey             = "i"
	CopiedFieldsKey     = "z"
)
View Source
const (
	AlgorithmSHA256 = "rsa-sha256"
)
View Source
const (
	SignatureHeaderKey = "DKIM-Signature"
)

Variables

View Source
var StdSignableHeaders = []string{
	"Cc",
	"Content-Type",
	"Date",
	"From",
	"Reply-To",
	"Subject",
	"To",
	SignatureHeaderKey,
}

Functions

This section is empty.

Types

type Conf

type Conf map[string]string

func NewConf

func NewConf(domain string, selector string) (Conf, error)

func (Conf) Algorithm

func (c Conf) Algorithm() string

func (Conf) Hash

func (c Conf) Hash() crypto.Hash

func (Conf) RelaxedBody

func (c Conf) RelaxedBody() bool

func (Conf) RelaxedHeader

func (c Conf) RelaxedHeader() bool

func (Conf) String

func (c Conf) String() string

func (Conf) Validate

func (c Conf) Validate() error

type DKIM

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

func New

func New(conf Conf, keyPEM []byte) (d *DKIM, err error)

func (*DKIM) Sign

func (d *DKIM) Sign(eml []byte) (signed []byte, err error)
type Header string

func NewHeader

func NewHeader(key, value string) Header

func (Header) Canonical

func (h Header) Canonical(relax bool) string

Canonical returns the (relaxed) canonical header

func (Header) Component

func (h Header) Component(i int) (c string)

Component returns the raw header component. Components are separated by colons.

func (Header) Key

func (h Header) Key(relax bool) string

Key returns the (relaxed) key with leading and trailing whitespace trimmed.

func (Header) Value

func (h Header) Value(relax bool) string

Value returns the (relaxed) value with leading and trailing whitespace trimmed

type HeaderList

type HeaderList []Header

func ParseHeaderList

func ParseHeaderList(header []byte) (list HeaderList)

func (HeaderList) Canonical

func (l HeaderList) Canonical(relaxed bool) string

func (HeaderList) Fields

func (l HeaderList) Fields() string

func (HeaderList) Get

func (l HeaderList) Get(key string) (h Header)

type Signer

type Signer interface {
	Sign(eml []byte) (signed []byte, err error)
}

Jump to

Keyboard shortcuts

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