Merge branch 'master' of https://github.com/andres-erbsen/go-dkim
Conflicts: dkim.go dkim_test.go pubKeyRep.go
This commit is contained in:
19
README.md
19
README.md
@@ -1,13 +1,14 @@
|
||||
# go-dkim
|
||||
DKIM package for Golang
|
||||
|
||||
[](https://godoc.org/github.com/toorop/go-dkim)
|
||||
Fork of `toorop`'s DKIM with non-pointer API and bugfixes.
|
||||
|
||||
[](https://godoc.org/github.com/andres-erbsen/go-dkim)
|
||||
|
||||
## Getting started
|
||||
|
||||
### Install
|
||||
```
|
||||
go get github.com/toorop/go-dkim
|
||||
go get github.com/andres-erbsen/go-dkim
|
||||
```
|
||||
Warning: you need to use Go 1.4.2-master or 1.4.3 (when it will be available)
|
||||
see https://github.com/golang/go/issues/10482 fro more info.
|
||||
@@ -16,12 +17,13 @@ see https://github.com/golang/go/issues/10482 fro more info.
|
||||
|
||||
```go
|
||||
import (
|
||||
dkim "github.com/toorop/go-dkim"
|
||||
dkim "github.com/andres-erbsen/go-dkim"
|
||||
)
|
||||
|
||||
func main(){
|
||||
// email is the email to sign (byte slice)
|
||||
// privateKey the private key (pem encoded, byte slice )
|
||||
// privateKey the private key (pem encoded, byte slice )
|
||||
dkim := dkim.NewDkim()
|
||||
options := dkim.NewSigOptions()
|
||||
options.PrivateKey = privateKey
|
||||
options.Domain = "mydomain.tld"
|
||||
@@ -33,8 +35,6 @@ func main(){
|
||||
options.Canonicalization = "relaxed/relaxed"
|
||||
err := dkim.Sign(&email, options)
|
||||
// handle err..
|
||||
|
||||
// And... that's it, 'email' is signed ! Amazing© !!!
|
||||
}
|
||||
```
|
||||
|
||||
@@ -46,11 +46,12 @@ import (
|
||||
|
||||
func main(){
|
||||
// email is the email to verify (byte slice)
|
||||
status, err := Verify(&email)
|
||||
// handle status, err (see godoc for status)
|
||||
dkim := dkim.NewDkim()
|
||||
_, err := dkim.Verify(email)
|
||||
}
|
||||
```
|
||||
|
||||
## Todo
|
||||
|
||||
- [ ] handle z tag (copied header fields used for diagnostic use)
|
||||
- [ ] handle multiple dns records
|
||||
|
||||
Reference in New Issue
Block a user