This produce a standard PKCS1.5 padding for encryption
Modulecryptonite-0.30Haskell2010
Crypto.PubKey.RSA.PKCS15
- 1 class
- 9 values
- Packagecryptonite-0.30
- Exports10
- LanguageHaskell2010
- LicenceBSD-3-Clause
- SourcePKCS15.hs
Padding and unpadding
3 declarationsProduce a standard PKCS1.5 padding for signature
Try to remove a standard PKCS1.5 encryption padding.
Private key operations
4 declarationsdecrypt :: Maybe Blinderoptional blinder
-> PrivateKeyRSA private key
-> ByteStringcipher text
-> 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.
decryptSafer :: MonadRandom m=> PrivateKeyRSA private key
-> ByteStringcipher text
-> m (Either Error ByteString)
decrypt message using the private key and by automatically generating a blinder.
sign :: HashAlgorithmASN1 hashAlg=> Maybe Blinderoptional blinder
-> Maybe hashAlghash algorithm
-> PrivateKeyprivate key
-> ByteStringmessage to sign
-> 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
signSafer :: (HashAlgorithmASN1 hashAlg, MonadRandom m)=> Maybe hashAlgHash algorithm
-> PrivateKeyprivate key
-> ByteStringmessage to sign
-> m (Either Error ByteString)
sign message using the private key and by automatically generating a blinder.
Public key operations
2 declarationsencrypt a bytestring using the public key.
The message needs to be smaller than the key size - 11. The message should not be padded.
verify message with the signed message
Hash ASN1 description
1 declarationA specialized class for hash algorithm that can product a ASN1 wrapped description the algorithm plus the content of the digest.
Instances10HashAlgorithmASN1, …
HashAlgorithmASN1 MD2Defined in cryptonite-0.30 · Crypto.PubKey.RSA.PKCS15HashAlgorithmASN1 MD5Defined in cryptonite-0.30 · Crypto.PubKey.RSA.PKCS15HashAlgorithmASN1 RIPEMD160Defined in cryptonite-0.30 · Crypto.PubKey.RSA.PKCS15HashAlgorithmASN1 SHA1Defined in cryptonite-0.30 · Crypto.PubKey.RSA.PKCS15HashAlgorithmASN1 SHA224Defined in cryptonite-0.30 · Crypto.PubKey.RSA.PKCS15HashAlgorithmASN1 SHA256Defined in cryptonite-0.30 · Crypto.PubKey.RSA.PKCS15HashAlgorithmASN1 SHA384Defined in cryptonite-0.30 · Crypto.PubKey.RSA.PKCS15HashAlgorithmASN1 SHA512Defined in cryptonite-0.30 · Crypto.PubKey.RSA.PKCS15HashAlgorithmASN1 SHA512t_224Defined in cryptonite-0.30 · Crypto.PubKey.RSA.PKCS15HashAlgorithmASN1 SHA512t_256Defined in cryptonite-0.30 · Crypto.PubKey.RSA.PKCS15