export SigOptions
This commit is contained in:
8
dkim.go
8
dkim.go
@@ -38,7 +38,7 @@ const (
|
|||||||
)
|
)
|
||||||
|
|
||||||
// sigOptions represents signing options
|
// sigOptions represents signing options
|
||||||
type sigOptions struct {
|
type SigOptions struct {
|
||||||
|
|
||||||
// DKIM version (default 1)
|
// DKIM version (default 1)
|
||||||
Version uint
|
Version uint
|
||||||
@@ -84,8 +84,8 @@ type sigOptions struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// NewSigOption returns new sigoption with some defaults value
|
// NewSigOption returns new sigoption with some defaults value
|
||||||
func NewSigOptions() sigOptions {
|
func NewSigOptions() SigOptions {
|
||||||
return sigOptions{
|
return SigOptions{
|
||||||
Version: 1,
|
Version: 1,
|
||||||
Canonicalization: "simple/simple",
|
Canonicalization: "simple/simple",
|
||||||
Algo: "rsa-sha256",
|
Algo: "rsa-sha256",
|
||||||
@@ -98,7 +98,7 @@ func NewSigOptions() sigOptions {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Sign signs an email
|
// Sign signs an email
|
||||||
func Sign(email *[]byte, options sigOptions) error {
|
func Sign(email *[]byte, options SigOptions) error {
|
||||||
var privateKey *rsa.PrivateKey
|
var privateKey *rsa.PrivateKey
|
||||||
|
|
||||||
// PrivateKey
|
// PrivateKey
|
||||||
|
|||||||
@@ -197,7 +197,7 @@ type dkimHeader struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// NewDkimHeaderBySigOptions return a new DkimHeader initioalized with sigOptions value
|
// NewDkimHeaderBySigOptions return a new DkimHeader initioalized with sigOptions value
|
||||||
func newDkimHeaderBySigOptions(options sigOptions) *dkimHeader {
|
func newDkimHeaderBySigOptions(options SigOptions) *dkimHeader {
|
||||||
h := new(dkimHeader)
|
h := new(dkimHeader)
|
||||||
h.Version = "1"
|
h.Version = "1"
|
||||||
h.Algorithm = options.Algo
|
h.Algorithm = options.Algo
|
||||||
|
|||||||
Reference in New Issue
Block a user