Maintainer | John Galt <jgalt@centromere.net> |
---|---|
Stability | experimental |
Portability | POSIX |
Safe Haskell | None |
Language | Haskell2010 |
Synopsis
- class DH d where
- data PublicKey d :: *
- data SecretKey d :: *
- dhName :: proxy d -> ScrubbedBytes
- dhLength :: proxy d -> Int
- dhGenKey :: IO (KeyPair d)
- dhPerform :: SecretKey d -> PublicKey d -> ScrubbedBytes
- dhPubToBytes :: PublicKey d -> ScrubbedBytes
- dhBytesToPub :: ScrubbedBytes -> Maybe (PublicKey d)
- dhSecToBytes :: SecretKey d -> ScrubbedBytes
- dhBytesToPair :: ScrubbedBytes -> Maybe (KeyPair d)
- dhPubEq :: PublicKey d -> PublicKey d -> Bool
- type KeyPair d = (SecretKey d, PublicKey d)
Classes
Typeclass for Diffie-Hellman key agreement.
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.