module Network.DomainAuth.DK.Types where
import Data.ByteString (ByteString)
import qualified Data.Map as M
import Network.DNS
import Network.DomainAuth.Mail
dkFieldKey :: CanonFieldKey
dkFieldKey = "domainkey-signature"
data DkAlgorithm = DK_RSA_SHA1 deriving (Eq,Show)
data DkCanonAlgo = DK_SIMPLE | DK_NOFWS deriving (Eq,Show)
type DkFields = M.Map ByteString Bool
data DK = DK {
dkAlgorithm :: DkAlgorithm
, dkSignature :: ByteString
, dkCanonAlgo :: DkCanonAlgo
, dkDomain0 :: ByteString
, dkFields :: Maybe DkFields
, dkSelector0 :: ByteString
} deriving (Eq,Show)
dkDomain :: DK -> Domain
dkDomain = dkDomain0
dkSelector :: DK -> ByteString
dkSelector = dkSelector0