crypto-pubkey-0.2.4: Public Key cryptography

PortabilityGood
Stabilityexperimental
MaintainerVincent Hanquez <vincent@snarc.org>
Safe HaskellNone

Crypto.PubKey.RSA.PSS

Contents

Description

 

Synopsis

Documentation

data PSSParams Source

Parameters for PSS signature/verification.

Constructors

PSSParams 

Fields

pssHash :: HashFunction

Hash function to use

pssMaskGenAlg :: MaskGenAlgorithm

Mask Gen algorithm to use

pssSaltLength :: Int

Length of salt. need to be <= to hLen.

pssTrailerField :: Word8

Trailer field, usually 0xbc

defaultPSSParams :: HashFunction -> PSSParamsSource

Default Params with a specified hash function

defaultPSSParamsSHA1 :: PSSParamsSource

Default Params using SHA1 algorithm.

Sign and verify functions

signWithSaltSource

Arguments

:: ByteString

Salt to use

-> Maybe Blinder

optional blinder to use

-> PSSParams

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

signSource

Arguments

:: CPRG g 
=> g

random generator to use to generate the salt

-> Maybe Blinder

optional blinder to use

-> PSSParams

PSS Parameters to use

-> PrivateKey

RSA Private Key

-> ByteString

Message to sign

-> (Either Error ByteString, g) 

Sign using the PSS Parameters

signSaferSource

Arguments

:: CPRG g 
=> g

random generator

-> PSSParams

PSS Parameters to use

-> PrivateKey

private key

-> ByteString

message to sign

-> (Either Error ByteString, g) 

Sign using the PSS Parameters and an automatically generated blinder.

verifySource

Arguments

:: PSSParams

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