License | BSD-style |
---|---|
Maintainer | Vincent Hanquez <vincent@snarc.org> |
Stability | experimental |
Portability | Good |
Safe Haskell | None |
Language | Haskell2010 |
Synopsis
-
data
PSSParams
hash seed output =
PSSParams
{
- pssHash :: hash
- pssMaskGenAlg :: MaskGenAlgorithm seed output
- pssSaltLength :: Int
- pssTrailerField :: Word8
- defaultPSSParams :: ( ByteArrayAccess seed, ByteArray output, HashAlgorithm hash) => hash -> PSSParams hash seed output
- defaultPSSParamsSHA1 :: PSSParams SHA1 ByteString ByteString
- signWithSalt :: HashAlgorithm hash => ByteString -> Maybe Blinder -> PSSParams hash ByteString ByteString -> PrivateKey -> ByteString -> Either Error ByteString
- signDigestWithSalt :: HashAlgorithm hash => ByteString -> Maybe Blinder -> PSSParams hash ByteString ByteString -> PrivateKey -> Digest hash -> Either Error ByteString
- sign :: ( HashAlgorithm hash, MonadRandom m) => Maybe Blinder -> PSSParams hash ByteString ByteString -> PrivateKey -> ByteString -> m ( Either Error ByteString )
- signDigest :: ( HashAlgorithm hash, MonadRandom m) => Maybe Blinder -> PSSParams hash ByteString ByteString -> PrivateKey -> Digest hash -> m ( Either Error ByteString )
- signSafer :: ( HashAlgorithm hash, MonadRandom m) => PSSParams hash ByteString ByteString -> PrivateKey -> ByteString -> m ( Either Error ByteString )
- signDigestSafer :: ( HashAlgorithm hash, MonadRandom m) => PSSParams hash ByteString ByteString -> PrivateKey -> Digest hash -> m ( Either Error ByteString )
- verify :: HashAlgorithm hash => PSSParams hash ByteString ByteString -> PublicKey -> ByteString -> ByteString -> Bool
- verifyDigest :: HashAlgorithm hash => PSSParams hash ByteString ByteString -> PublicKey -> Digest hash -> ByteString -> Bool
Documentation
data PSSParams hash seed output Source #
Parameters for PSS signature/verification.
PSSParams | |
|
defaultPSSParams :: ( ByteArrayAccess seed, ByteArray output, HashAlgorithm hash) => hash -> PSSParams hash seed output Source #
Default Params with a specified hash function
defaultPSSParamsSHA1 :: PSSParams SHA1 ByteString ByteString Source #
Default Params using SHA1 algorithm.
Sign and verify functions
:: 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
:: 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
:: ( 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
:: ( 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
:: ( 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.
:: ( 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.
:: 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
:: 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