Documentation ¶
Index ¶
- Constants
- type Canon
- type Dkim
- func (d *Dkim) Body(data []byte) Status
- func (d *Dkim) Destroy() Status
- func (d *Dkim) Eoh() Status
- func (d *Dkim) Eom(testKey *bool) Status
- func (d *Dkim) GetError() string
- func (d *Dkim) GetSigHdr(buf []byte) ([]byte, Status)
- func (d *Dkim) GetSignature() *Signature
- func (d *Dkim) Header(line string) Status
- func (d *Dkim) Sign(r io.Reader) ([]byte, error)
- func (d *Dkim) Verify(r io.Reader) Status
- type Lib
- type Op
- type Option
- type Sigflag
- type Sign
- type Signature
- type Status
Constants ¶
View Source
const ( StatusOK = 0 // function completed successfully StatusBADSIG = 1 // signature available but failed StatusNOSIG = 2 // no signature available StatusNOKEY = 3 // public key not found StatusCANTVRFY = 4 // can't get domain key to verify StatusSYNTAX = 5 // message is not valid syntax StatusNORESOURCE = 6 // resource unavailable StatusINTERNAL = 7 // internal error StatusREVOKED = 8 // key found, but revoked StatusINVALID = 9 // invalid function parameter StatusNOTIMPLEMENT = 10 // function not implemented StatusKEYFAIL = 11 // key retrieval failed StatusCBREJECT = 12 // callback requested reject StatusCBINVALID = 13 // callback gave invalid result StatusCBTRYAGAIN = 14 // callback says try again later StatusCBERROR = 15 // callback error StatusMULTIDNSREPLY = 16 // multiple DNS replies StatusSIGGEN = 17 // signature generation failed )
View Source
const ( LibflagsNONE = 0x0000 LibflagsTMPFILES = 0x0001 LibflagsKEEPFILES = 0x0002 LibflagsSIGNLEN = 0x0004 LibflagsCACHE = 0x0008 LibflagsZTAGS = 0x0010 LibflagsDELAYSIGPROC = 0x0020 LibflagsEOHCHECK = 0x0040 LibflagsACCEPTV05 = 0x0080 LibflagsFIXCRLF = 0x0100 LibflagsACCEPTDK = 0x0200 LibflagsBADSIGHANDLES = 0x0400 LibflagsVERIFYONE = 0x0800 LibflagsSTRICTHDRS = 0x1000 LibflagsREPORTBADADSP = 0x2000 LibflagsDROPSIGNER = 0x4000 LibflagsSTRICTRESIGN = 0x8000 )
View Source
const ( SigflagIGNORE = 0x01 SigflagPROCESSED = 0x02 SigflagPASSED = 0x04 SigflagTESTKEY = 0x08 SigflagNOSUBDOMAIN = 0x10 SigflagKEYLOADED = 0x20 )
View Source
const ( QueryUNKNOWN = (-1) // unknown method QueryDNS = 0 // DNS query method (per the draft) QueryFILE = 1 // text file method (for testing) )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Dkim ¶
type Dkim struct {
// contains filtered or unexported fields
}
Dkim handle
func (*Dkim) GetSignature ¶
GetSignature returns the signature. Eom must be called before invoking GetSignature.
type Lib ¶
type Lib struct {
// contains filtered or unexported fields
}
Lib is a dkim library handle
func (*Lib) NewSigner ¶
func (lib *Lib) NewSigner(secret, selector, domain string, hdrCanon, bodyCanon Canon, algo Sign, bytesToSign int64) (*Dkim, Status)
NewSigner creates a new DKIM handle for message signing. If -1 is specified for bytesToSign, the whole message body will be signed.
func (*Lib) NewVerifier ¶
NewVerifier creates a new DKIM verifier
type Option ¶
type Option int
const ( OptionFLAGS Option = 0 OptionTMPDIR Option = 1 OptionTIMEOUT Option = 2 OptionSENDERHDRS Option = 3 OptionSIGNHDRS Option = 4 OptionOVERSIGNHDRS Option = 5 OptionQUERYMETHOD Option = 6 OptionQUERYINFO Option = 7 OptionFIXEDTIME Option = 8 OptionSKIPHDRS Option = 9 OptionALWAYSHDRS Option = 10 // obsolete OptionSIGNATURETTL Option = 11 OptionCLOCKDRIFT Option = 12 OptionMUSTBESIGNED Option = 13 OptionMINKEYBITS Option = 14 OptionREQUIREDHDRS Option = 15 )
Click to show internal directories.
Click to hide internal directories.