crypto-pubkey-types-0.4.3: Generic cryptography Public keys algorithm types

License | BSD-style
Maintainer | Vincent Hanquez <vincent@snarc.org>
Stability | Stable
Portability | Excellent
Safe Haskell | None
Language | Haskell98

Crypto.Types.PubKey.DSA

Description

Synopsis

- data Params = Params {
  - params_p :: Integer
  - params_g :: Integer
  - params_q :: Integer
  }
- data Signature = Signature {
  - sign_r :: Integer
  - sign_s :: Integer
  }
- type PublicNumber = Integer
- data PublicKey = PublicKey {
  - public_params :: Params
  - public_y :: PublicNumber
  }
- type PrivateNumber = Integer
- data PrivateKey = PrivateKey {
  - private_params :: Params
  - private_x :: PrivateNumber
  }
- data KeyPair = KeyPair Params PublicNumber PrivateNumber
- toPublicKey :: KeyPair -> PublicKey
- toPrivateKey :: KeyPair -> PrivateKey

# Documentation

data Params Source #

Represent DSA parameters namely P, G, and Q.

Constructors

Params |

Fields

- params_p :: Integer

  DSA p

- params_g :: Integer

  DSA g

- params_q :: Integer

  DSA q

#### Instances

Instances details

ASN1Object Params Source # |
Instance details Defined in Crypto.Types.PubKey.DSA Methods toASN1 :: Params -> ASN1S Source # fromASN1 :: [ASN1] -> Either String (Params, [ASN1]) Source #
Data Params Source # |

Instance details

Defined in Crypto.Types.PubKey.DSA

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Params -> c Params Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Params Source #

toConstr :: Params -> Constr Source #

dataTypeOf :: Params -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Params) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Params) Source #

gmapT :: (forall b. Data b => b -> b) -> Params -> Params Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Params -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Params -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> Params -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Params -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Params -> m Params Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Params -> m Params Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Params -> m Params Source #

Read Params Source # |
Instance details Defined in Crypto.Types.PubKey.DSA Methods readsPrec :: Int -> ReadS Params Source # readList :: ReadS [Params] Source # readPrec :: ReadPrec Params Source # readListPrec :: ReadPrec [Params] Source #
Show Params Source # |
Instance details Defined in Crypto.Types.PubKey.DSA Methods showsPrec :: Int -> Params -> ShowS Source # show :: Params -> String Source # showList :: [Params] -> ShowS Source #
Eq Params Source # |
Instance details Defined in Crypto.Types.PubKey.DSA Methods (==) :: Params -> Params -> Bool Source # (/=) :: Params -> Params -> Bool Source #

data Signature Source #

Represent a DSA signature namely R and S.

Constructors

Signature |

Fields

- sign_r :: Integer

  DSA r

- sign_s :: Integer

  DSA s

#### Instances

Instances details

ASN1Object Signature Source # |
Instance details Defined in Crypto.Types.PubKey.DSA Methods toASN1 :: Signature -> ASN1S Source # fromASN1 :: [ASN1] -> Either String (Signature, [ASN1]) Source #
Data Signature Source # |

Instance details

Defined in Crypto.Types.PubKey.DSA

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Signature -> c Signature Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Signature Source #

toConstr :: Signature -> Constr Source #

dataTypeOf :: Signature -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Signature) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Signature) Source #

gmapT :: (forall b. Data b => b -> b) -> Signature -> Signature Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Signature -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Signature -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> Signature -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Signature -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Signature -> m Signature Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Signature -> m Signature Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Signature -> m Signature Source #

Read Signature Source # |
Instance details Defined in Crypto.Types.PubKey.DSA Methods readsPrec :: Int -> ReadS Signature Source # readList :: ReadS [Signature] Source # readPrec :: ReadPrec Signature Source # readListPrec :: ReadPrec [Signature] Source #
Show Signature Source # |
Instance details Defined in Crypto.Types.PubKey.DSA Methods showsPrec :: Int -> Signature -> ShowS Source # show :: Signature -> String Source # showList :: [Signature] -> ShowS Source #
Eq Signature Source # |
Instance details Defined in Crypto.Types.PubKey.DSA Methods (==) :: Signature -> Signature -> Bool Source # (/=) :: Signature -> Signature -> Bool Source #

type PublicNumber = Integer Source #

DSA Public Number, usually embedded in DSA Public Key

data PublicKey Source #

Represent a DSA public key.

Constructors

PublicKey |

Fields

- public_params :: Params

  DSA parameters

- public_y :: PublicNumber

  DSA public Y

#### Instances

Instances details

ASN1Object PublicKey Source # |
Instance details Defined in Crypto.Types.PubKey.DSA Methods toASN1 :: PublicKey -> ASN1S Source # fromASN1 :: [ASN1] -> Either String (PublicKey, [ASN1]) Source #
Data PublicKey Source # |

Instance details

Defined in Crypto.Types.PubKey.DSA

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> PublicKey -> c PublicKey Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c PublicKey Source #

toConstr :: PublicKey -> Constr Source #

dataTypeOf :: PublicKey -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c PublicKey) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c PublicKey) Source #

gmapT :: (forall b. Data b => b -> b) -> PublicKey -> PublicKey Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> PublicKey -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> PublicKey -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> PublicKey -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> PublicKey -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> PublicKey -> m PublicKey Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> PublicKey -> m PublicKey Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> PublicKey -> m PublicKey Source #

Read PublicKey Source # |
Instance details Defined in Crypto.Types.PubKey.DSA Methods readsPrec :: Int -> ReadS PublicKey Source # readList :: ReadS [PublicKey] Source # readPrec :: ReadPrec PublicKey Source # readListPrec :: ReadPrec [PublicKey] Source #
Show PublicKey Source # |
Instance details Defined in Crypto.Types.PubKey.DSA Methods showsPrec :: Int -> PublicKey -> ShowS Source # show :: PublicKey -> String Source # showList :: [PublicKey] -> ShowS Source #
Eq PublicKey Source # |
Instance details Defined in Crypto.Types.PubKey.DSA Methods (==) :: PublicKey -> PublicKey -> Bool Source # (/=) :: PublicKey -> PublicKey -> Bool Source #

type PrivateNumber = Integer Source #

DSA Private Number, usually embedded in DSA Private Key

data PrivateKey Source #

Represent a DSA private key.

Only x need to be secret. the DSA parameters are publicly shared with the other side.

Constructors

PrivateKey |

Fields

- private_params :: Params

  DSA parameters

- private_x :: PrivateNumber

  DSA private X

#### Instances

Instances details

Data PrivateKey Source # |

Instance details

Defined in Crypto.Types.PubKey.DSA

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> PrivateKey -> c PrivateKey Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c PrivateKey Source #

toConstr :: PrivateKey -> Constr Source #

dataTypeOf :: PrivateKey -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c PrivateKey) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c PrivateKey) Source #

gmapT :: (forall b. Data b => b -> b) -> PrivateKey -> PrivateKey Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> PrivateKey -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> PrivateKey -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> PrivateKey -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> PrivateKey -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> PrivateKey -> m PrivateKey Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> PrivateKey -> m PrivateKey Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> PrivateKey -> m PrivateKey Source #

Read PrivateKey Source # |
Instance details Defined in Crypto.Types.PubKey.DSA Methods readsPrec :: Int -> ReadS PrivateKey Source # readList :: ReadS [PrivateKey] Source # readPrec :: ReadPrec PrivateKey Source # readListPrec :: ReadPrec [PrivateKey] Source #
Show PrivateKey Source # |
Instance details Defined in Crypto.Types.PubKey.DSA Methods showsPrec :: Int -> PrivateKey -> ShowS Source # show :: PrivateKey -> String Source # showList :: [PrivateKey] -> ShowS Source #
Eq PrivateKey Source # |
Instance details Defined in Crypto.Types.PubKey.DSA Methods (==) :: PrivateKey -> PrivateKey -> Bool Source # (/=) :: PrivateKey -> PrivateKey -> Bool Source #

data KeyPair Source #

Represent a DSA key pair

Constructors

KeyPair Params PublicNumber PrivateNumber |

#### Instances

Instances details

ASN1Object KeyPair Source # |
Instance details Defined in Crypto.Types.PubKey.DSA Methods toASN1 :: KeyPair -> ASN1S Source # fromASN1 :: [ASN1] -> Either String (KeyPair, [ASN1]) Source #
Data KeyPair Source # |

Instance details

Defined in Crypto.Types.PubKey.DSA

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> KeyPair -> c KeyPair Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c KeyPair Source #

toConstr :: KeyPair -> Constr Source #

dataTypeOf :: KeyPair -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c KeyPair) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c KeyPair) Source #

gmapT :: (forall b. Data b => b -> b) -> KeyPair -> KeyPair Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> KeyPair -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> KeyPair -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> KeyPair -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> KeyPair -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> KeyPair -> m KeyPair Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> KeyPair -> m KeyPair Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> KeyPair -> m KeyPair Source #

Read KeyPair Source # |
Instance details Defined in Crypto.Types.PubKey.DSA Methods readsPrec :: Int -> ReadS KeyPair Source # readList :: ReadS [KeyPair] Source # readPrec :: ReadPrec KeyPair Source # readListPrec :: ReadPrec [KeyPair] Source #
Show KeyPair Source # |
Instance details Defined in Crypto.Types.PubKey.DSA Methods showsPrec :: Int -> KeyPair -> ShowS Source # show :: KeyPair -> String Source # showList :: [KeyPair] -> ShowS Source #
Eq KeyPair Source # |
Instance details Defined in Crypto.Types.PubKey.DSA Methods (==) :: KeyPair -> KeyPair -> Bool Source # (/=) :: KeyPair -> KeyPair -> Bool Source #

toPublicKey :: KeyPair -> PublicKey Source #

Public key of a DSA Key pair

toPrivateKey :: KeyPair -> PrivateKey Source #

Private key of a DSA Key pair