C# Класс Org.BouncyCastle.Crypto.Signers.Iso9796d2PssSigner

ISO9796-2 - mechanism using a hash function with recovery (scheme 2 and 3).

Note: the usual length for the salt is the length of the hash function used in bytes.

Наследование: ISignerWithRecovery
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
BlockUpdate ( byte input, int inOff, int length ) : void

update the internal digest with the byte array in

GenerateSignature ( ) : byte[]

Generate a signature for the loaded message using the key we were initialised with.

GetRecoveredMessage ( ) : byte[]

Return a reference to the recoveredMessage message.

HasFullMessage ( ) : bool

Return true if the full message was recoveredMessage.

Init ( bool forSigning, ICipherParameters parameters ) : void

Initialise the signer.

Iso9796d2PssSigner ( IAsymmetricBlockCipher cipher, IDigest digest, int saltLength ) : System

Constructor for a signer with an explicit digest trailer.

Iso9796d2PssSigner ( IAsymmetricBlockCipher cipher, IDigest digest, int saltLength, bool isImplicit ) : System

Generate a signer for the with either implicit or explicit trailers for ISO9796-2, scheme 2 or 3.

Reset ( ) : void

reset the internal state

Update ( byte input ) : void

update the internal digest with the byte b

VerifySignature ( byte signature ) : bool

return true if the signature represents a ISO9796-2 signature for the passed in message.

Приватные методы

Метод Описание
ClearBlock ( byte block ) : void

clear possible sensitive data

IsSameAs ( byte a, byte b ) : bool

compare two byte arrays.

ItoOSP ( int i, byte sp ) : void

int to octet string.

int to octet string.

LtoOSP ( long l, byte sp ) : void

long to octet string.

MaskGeneratorFunction1 ( byte Z, int zOff, int zLen, int length ) : byte[]

mask generator function, as described in Pkcs1v2.

Описание методов

BlockUpdate() публичный Метод

update the internal digest with the byte array in
public BlockUpdate ( byte input, int inOff, int length ) : void
input byte
inOff int
length int
Результат void

GenerateSignature() публичный Метод

Generate a signature for the loaded message using the key we were initialised with.
public GenerateSignature ( ) : byte[]
Результат byte[]

GetRecoveredMessage() публичный Метод

Return a reference to the recoveredMessage message.
public GetRecoveredMessage ( ) : byte[]
Результат byte[]

HasFullMessage() публичный Метод

Return true if the full message was recoveredMessage.
public HasFullMessage ( ) : bool
Результат bool

Init() публичный Метод

Initialise the signer.
if wrong parameter type or a fixed /// salt is passed in which is the wrong length. ///
public Init ( bool forSigning, ICipherParameters parameters ) : void
forSigning bool true if for signing, false if for verification.
parameters ICipherParameters parameters for signature generation/verification. If the /// parameters are for generation they should be a ParametersWithRandom, /// a ParametersWithSalt, or just an RsaKeyParameters object. If RsaKeyParameters /// are passed in a SecureRandom will be created. ///
Результат void

Iso9796d2PssSigner() публичный Метод

Constructor for a signer with an explicit digest trailer.
public Iso9796d2PssSigner ( IAsymmetricBlockCipher cipher, IDigest digest, int saltLength ) : System
cipher IAsymmetricBlockCipher cipher to use. ///
digest IDigest digest to sign with. ///
saltLength int length of salt in bytes. ///
Результат System

Iso9796d2PssSigner() публичный Метод

Generate a signer for the with either implicit or explicit trailers for ISO9796-2, scheme 2 or 3.
public Iso9796d2PssSigner ( IAsymmetricBlockCipher cipher, IDigest digest, int saltLength, bool isImplicit ) : System
cipher IAsymmetricBlockCipher base cipher to use for signature creation/verification
digest IDigest digest to use.
saltLength int length of salt in bytes.
isImplicit bool whether or not the trailer is implicit or gives the hash.
Результат System

Reset() публичный Метод

reset the internal state
public Reset ( ) : void
Результат void

Update() публичный Метод

update the internal digest with the byte b
public Update ( byte input ) : void
input byte
Результат void

VerifySignature() публичный Метод

return true if the signature represents a ISO9796-2 signature for the passed in message.
public VerifySignature ( byte signature ) : bool
signature byte
Результат bool