cryptonite-0.29: Cryptography Primitives sink
LicenseBSD-style
MaintainerVincent Hanquez <vincent@snarc.org>
Stabilityexperimental
PortabilityGood
Safe HaskellNone
LanguageHaskell2010

Crypto.PubKey.RSA.PSS

Description

 
Synopsis

Documentation

data PSSParams hash seed output #

Parameters for PSS signature/verification.

Constructors

PSSParams 

Fields

defaultPSSParams :: (ByteArrayAccess seed, ByteArray output, HashAlgorithm hash) => hash -> PSSParams hash seed output #

Default Params with a specified hash function

defaultPSSParamsSHA1 :: PSSParams SHA1 ByteString ByteString #

Default Params using SHA1 algorithm.

Sign and verify functions

signWithSalt #

Arguments

:: HashAlgorithm hash 
=> ByteString

Salt to use

-> Maybe Blinder

optional blinder to use

-> PSSParams hash ByteString ByteString

PSS Parameters to use

-> PrivateKey

RSA Private Key

-> ByteString

Message to sign

-> Either Error ByteString 

Sign using the PSS parameters and the salt explicitely passed as parameters.

the function ignore SaltLength from the PSS Parameters

signDigestWithSalt #

Arguments

:: HashAlgorithm hash 
=> ByteString

Salt to use

-> Maybe Blinder

optional blinder to use

-> PSSParams hash ByteString ByteString

PSS Parameters to use

-> PrivateKey

RSA Private Key

-> Digest hash

Message digest

-> Either Error ByteString 

Sign using the PSS parameters and the salt explicitely passed as parameters.

the function ignore SaltLength from the PSS Parameters

sign #

Arguments

:: (HashAlgorithm hash, MonadRandom m) 
=> Maybe Blinder

optional blinder to use

-> PSSParams hash ByteString ByteString

PSS Parameters to use

-> PrivateKey

RSA Private Key

-> ByteString

Message to sign

-> m (Either Error ByteString) 

Sign using the PSS Parameters

signDigest #

Arguments

:: (HashAlgorithm hash, MonadRandom m) 
=> Maybe Blinder

optional blinder to use

-> PSSParams hash ByteString ByteString

PSS Parameters to use

-> PrivateKey

RSA Private Key

-> Digest hash

Message digest

-> m (Either Error ByteString) 

Sign using the PSS Parameters

signSafer #

Arguments

:: (HashAlgorithm hash, MonadRandom m) 
=> PSSParams hash ByteString ByteString

PSS Parameters to use

-> PrivateKey

private key

-> ByteString

message to sign

-> m (Either Error ByteString) 

Sign using the PSS Parameters and an automatically generated blinder.

signDigestSafer #

Arguments

:: (HashAlgorithm hash, MonadRandom m) 
=> PSSParams hash ByteString ByteString

PSS Parameters to use

-> PrivateKey

private key

-> Digest hash

message digst

-> m (Either Error ByteString) 

Sign using the PSS Parameters and an automatically generated blinder.

verify #

Arguments

:: HashAlgorithm hash 
=> PSSParams hash ByteString ByteString

PSS Parameters to use to verify, this need to be identical to the parameters when signing

-> PublicKey

RSA Public Key

-> ByteString

Message to verify

-> ByteString

Signature

-> Bool 

Verify a signature using the PSS Parameters

verifyDigest #

Arguments

:: HashAlgorithm hash 
=> PSSParams hash ByteString ByteString

PSS Parameters to use to verify, this need to be identical to the parameters when signing

-> PublicKey

RSA Public Key

-> Digest hash

Digest to verify

-> ByteString

Signature

-> Bool 

Verify a signature using the PSS Parameters