add struct for pubkey representation

This commit is contained in:
Stéphane Depierrepont aka Toorop
2015-05-12 11:59:34 +02:00
parent d652e23632
commit 7206fc7daf
5 changed files with 176 additions and 51 deletions

26
pubKeyRep.go Normal file
View File

@@ -0,0 +1,26 @@
package dkim
import (
"crypto/rsa"
"fmt"
"net"
)
// pubKeyRep represents a parsed version of public key record
type pubKeyRep struct {
Version string
HashAlgo []string
KeyType string
Note string
PubKey rsa.PublicKey
ServiceType []string
FlagTesting bool // flag y
FlagIMustBeD bool // flag i
}
func newPubKeyFromDnsTxt(selector, domain string) (*pubKeyRep, error) {
txt, err := net.LookupTXT(selector + "._domainkey." + domain)
fmt.Println(txt, err)
return nil, nil
}