Maintainer | John Galt <jgalt@centromere.net> |
---|---|
Stability | experimental |
Portability | POSIX |
Safe Haskell | None |
Language | Haskell2010 |
Classes
Typeclass for Diffie-Hellman key agreement.
dhName, dhLength, dhGenKey, dhPerform, dhPubToBytes, dhBytesToPub, dhSecToBytes, dhBytesToPair, dhPubEq
data PublicKey d :: * Source #
Represents a public key.
data SecretKey d :: * Source #
Represents a secret key.
dhName :: proxy d -> ScrubbedBytes Source #
Returns the name of the DH scheme. This is used when generating the handshake name.
dhLength :: proxy d -> Int Source #
Returns the length of public keys for this DH scheme in bytes.
dhGenKey :: IO (KeyPair d) Source #
Generates a KeyPair
.
dhPerform :: SecretKey d -> PublicKey d -> ScrubbedBytes Source #
Performs DH.
dhPubToBytes :: PublicKey d -> ScrubbedBytes Source #
Exports a PublicKey
.
dhBytesToPub :: ScrubbedBytes -> Maybe (PublicKey d) Source #
Imports a PublicKey
.
dhSecToBytes :: SecretKey d -> ScrubbedBytes Source #
Exports a SecretKey
.
dhBytesToPair :: ScrubbedBytes -> Maybe (KeyPair d) Source #
Imports a SecretKey
.
dhPubEq :: PublicKey d -> PublicKey d -> Bool Source #
Tests PublicKey
s for equality.