check sign config /1

This commit is contained in:
Stéphane Depierrepont aka Toorop
2015-05-02 20:11:15 +02:00
parent 65fcaeba7d
commit d3f8e980a0

38
dkim.go
View File

@@ -1 +1,39 @@
package dkim package dkim
import (
"bytes"
"time"
)
// sigOptions represents signing options
type sigOptions struct {
PrivateKey string
Domain string
Selector string
Auid string
Canonicalization string
Algo string
Headers []string
Timestamp time.Time
Expiration time.Time
}
// NewSigOption returns new sigoption with some defaults value
func NewSigOptions() sigOptions {
return sigOptions{
Canonicalization: "simple/simple",
Algo: "rsa-sha256",
}
}
// Sign signs an email
func Sign(email *bytes.Reader, options sigOptions) (*bytes.Reader, error) {
// check config
// private key (not empty & TODO: valid)
if options.PrivateKey == "" {
return nil, ErrConfigNoPrivateKey
}
return nil, nil
}