forked from kalloc/dkim
-
Notifications
You must be signed in to change notification settings - Fork 0
/
struct.go
42 lines (39 loc) · 1.31 KB
/
struct.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
package dkim
import (
"hash"
"net/mail"
)
type DKIM struct {
Header *DKIMHeader
HeaderName string
HeaderNameForHash string
RawMailHeader mail.Header
Hasher *hash.Hash
Mail *mail.Message
IsBodyRelaxed bool
IsHeaderRelaxed bool
Status struct {
HasPublicKey bool
ValidBody bool
Valid bool
}
PublicKey *DKIMPublicKey
headerHash []byte
bodyHash []byte
}
type DKIMHeader struct {
Version string `dkim:"v", json:"version"`
Algorithm string `dkim:"a", json:"algorithm"`
Canonization string `dkim:"c", json:"canonization"`
Domain string `dkim:"d", json:"domain"`
Selector string `dkim:"s", json:"selector"`
Headers []string `dkim:"h", json:"headers"`
Unixtime int `dkim:"t", json:"unixtime"`
BodyHash []byte `dkim:"bh", json:"body_hash"`
Signature []byte `dkim:"b", json:"signature"`
Identifier string `dkim:"i", json:"identifier"`
Length int `dkim:"l", json:"length"`
QueryType string `dkim:"q", json:"query_type"`
Expiration int `dkim:"x", json:"expiration"`
CopiedHeaders map[string]string `dkim:"z", json:"copied_headers"`
}