HORIZON HASKELLDocslts/ghc-10.0.x8fef28d2026-11-02Search packagesCtrl K
Theme: |

GHC 10.0.0.20260917 · lts/ghc-10.0.x · 8fef28d · 2026-11-02

  • PackageHsOpenSSL-0.11.7.11
  • Exports14
  • LanguageHaskell2010
  • LicenceLicenseRef-PublicDomain
  • SourceDSA.hsc

Type

classclass DSAKey k where

DSAKey a is either DSAPubKey or DSAKeyPair.

Methods

Instances2DSAKey
newtypenewtype DSAPubKey

The type of a DSA public key, includes parameters p, q, g and public.

Instances6Eq, Ord, Show, DSAKey, PKey, PublicKey
newtypenewtype DSAKeyPair

The type of a DSA keypair, includes parameters p, q, g, public and private.

Instances7Eq, Ord, Show, DSAKey, PKey, KeyPair, …

Key and parameter generation

valuegenerateDSAParameters
  1. :: Int

    The number of bits in the generated prime: 512 <= x <= 1024

  2. -> Maybe ByteString

    optional seed, its length must be 20 bytes

  3. -> IO (Int, Int, Integer, Integer, Integer)

    (iteration count, generator count, p, q, g)

Generate DSA parameters (*not* a key, but required for a key). This is a compute intensive operation. See FIPS 186-2, app 2. This agrees with the test vectors given in FIP 186-2, app 5

valuegenerateDSAParametersAndKey
  1. :: Int

    The number of bits in the generated prime: 512 <= x <= 1024

  2. -> Maybe ByteString

    optional seed, its length must be 20 bytes

  3. -> IO DSAKeyPair

A utility function to generate both the parameters and the key pair at the same time. Saves serialising and deserialising the parameters too

Signing and verification

Extracting fields of DSA objects