HsOpenSSL-0.11.7.9: Partial OpenSSL binding for Haskell

Safe Haskell | None
Language | Haskell2010

OpenSSL.DH

Description

Diffie-Hellman key exchange

Synopsis

- data DHP
- data DH
- data DHGen
  - = DHGen2
  - | DHGen5
- genDHParams :: DHGen -> Int -> IO DHP
- getDHLength :: DHP -> IO Int
- checkDHParams :: DHP -> IO Bool
- genDH :: DHP -> IO DH
- getDHParams :: DH -> DHP
- getDHPublicKey :: DH -> IO Integer
- computeDHKey :: DH -> Integer -> IO ByteString

# Documentation

data DHP Source #

data DH Source #

data DHGen Source #

Constructors

DHGen2 |
DHGen5 |

#### Instances

Instances details

Show DHGen Source # |
Instance details Defined in OpenSSL.DH Methods showsPrec :: Int -> DHGen -> ShowS Source # show :: DHGen -> String Source # showList :: [DHGen] -> ShowS Source #
Eq DHGen Source # |
Instance details Defined in OpenSSL.DH Methods (==) :: DHGen -> DHGen -> Bool Source # (/=) :: DHGen -> DHGen -> Bool Source #
Ord DHGen Source # |
Instance details Defined in OpenSSL.DH Methods compare :: DHGen -> DHGen -> Ordering Source # (<) :: DHGen -> DHGen -> Bool Source # (<=) :: DHGen -> DHGen -> Bool Source # (>) :: DHGen -> DHGen -> Bool Source # (>=) :: DHGen -> DHGen -> Bool Source # max :: DHGen -> DHGen -> DHGen Source # min :: DHGen -> DHGen -> DHGen Source #

genDHParams :: DHGen -> Int -> IO DHP Source #

``genDHParams` gen n` generates `n`-bit long DH parameters.

getDHLength :: DHP -> IO Int Source #

Get DH parameters length (in bits).

checkDHParams :: DHP -> IO Bool Source #

Check that DH parameters are coherent.

genDH :: DHP -> IO DH Source #

The first step of a key exchange. Public and private keys are generated.

getDHParams :: DH -> DHP Source #

Get parameters of a key exchange.

getDHPublicKey :: DH -> IO Integer Source #

Get the public key.

computeDHKey :: DH -> Integer -> IO ByteString Source #

Compute the shared key using the other party's public key.