domain-auth-0.2.2: Domain authentication library

Safe HaskellNone
LanguageHaskell2010

Network.DomainAuth.DK

Contents

Description

A library for DomainKeys (http://www.ietf.org/rfc/rfc4870.txt). Currently, only receiver side is implemented.

Synopsis

Documentation

Authentication with DK

runDK :: Resolver -> Mail -> IO DAResult Source #

Verifying Mail with DomainKeys.

runDK' :: Resolver -> Mail -> DK -> IO DAResult Source #

Verifying Mail with DomainKeys. The value of DomainKey-Signature: should be parsed beforehand.

Parsing DomainKey-Signature:

parseDK :: RawFieldValue -> Maybe DK Source #

Parsing DomainKey-Signature:.

>>> :{
let dk = BS8.concat [
                "a=rsa-sha1; s=brisbane; d=football.example.com;\n"
              , "  c=simple; q=dns;\n"
              , "  b=dzdVyOfAKCdLXdJOc9G2q8LoXSlEniSbav+yuU4zGeeruD00lszZ\n"
              , "    VoG4ZHRNiYzR;"
              ]
in pPrintNoColor $ parseDK dk
:}
Just 
    ( DK 
        { dkAlgorithm = DK_RSA_SHA1
        , dkSignature = "dzdVyOfAKCdLXdJOc9G2q8LoXSlEniSbav+yuU4zGeeruD00lszZVoG4ZHRNiYzR"
        , dkCanonAlgo = DK_SIMPLE
        , dkDomain0 = "football.example.com"
        , dkFields = Nothing
        , dkSelector0 = "brisbane"
        } 
    )

data DK Source #

Abstract type for DomainKey-Signature:

Instances

Eq DK Source # 

Methods

(==) :: DK -> DK -> Bool #

(/=) :: DK -> DK -> Bool #

Show DK Source # 

Methods

showsPrec :: Int -> DK -> ShowS #

show :: DK -> String #

showList :: [DK] -> ShowS #

dkDomain :: DK -> Domain Source #

Getting of the value of the "d" tag in DomainKey-Signature:.

dkSelector :: DK -> ByteString Source #

Getting of the value of the "s" tag in DomainKey-Signature:.

Field key for DomainKey-Signature:

dkFieldKey :: CanonFieldKey Source #

Canonicalized key for DomainKey-Signature:.