HORIZON HASKELLDocslts/ghc-9.10.xc74966e2026-09-27Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27

Modulecrypton-1.0.4Haskell2010

Crypto.PubKey.RSA.PKCS15

  • 1 class
  • 9 values
  • Packagecrypton-1.0.4
  • Exports10
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • SourcePKCS15.hs

Padding and unpadding

3 declarations
valueunpad :: ByteArray bytearray => bytearray -> Either Error bytearray
#

Try to remove a standard PKCS1.5 encryption padding.

Private key operations

4 declarations
valuedecrypt
  1. :: Maybe Blinder

    optional blinder

  2. -> PrivateKey

    RSA private key

  3. -> ByteString

    cipher text

  4. -> Either Error ByteString
#

decrypt message using the private key.

When the decryption is not in a context where an attacker could gain information from the timing of the operation, the blinder can be set to None.

If unsure always set a blinder or use decryptSafer

The message is returned un-padded.

valuesign
  1. :: HashAlgorithmASN1 hashAlg
  2. => Maybe Blinder

    optional blinder

  3. -> Maybe hashAlg

    hash algorithm

  4. -> PrivateKey

    private key

  5. -> ByteString

    message to sign

  6. -> Either Error ByteString
#

sign message using private key, a hash and its ASN1 description

When the signature is not in a context where an attacker could gain information from the timing of the operation, the blinder can be set to None.

If unsure always set a blinder or use signSafer

Public key operations

2 declarations

Hash ASN1 description

1 declaration
classclass HashAlgorithm hashAlg => HashAlgorithmASN1 hashAlg where
#

A specialized class for hash algorithm that can product a ASN1 wrapped description the algorithm plus the content of the digest.

Instances10HashAlgorithmASN1, …