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

Modulecryptonite-0.30Haskell2010

Crypto.PubKey.RSA.PKCS15

Contents
  1. Padding and unpadding
  2. Private key operations
  3. Public key operations
  4. Hash ASN1 description
Synopsis
  • Packagecryptonite-0.30
  • Exports10
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • SourcePKCS15.hs

Padding and unpadding

Private key operations

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

Hash ASN1 description

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, …