Table of Contents

Class Iso9796d2PssSigner

Namespace
Org.BouncyCastle.Crypto.Signers
Assembly
BouncyCastle.Cryptography.dll

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.

public class Iso9796d2PssSigner : ISignerWithRecovery, ISigner
Inheritance
Iso9796d2PssSigner
Implements
Inherited Members

Constructors

Iso9796d2PssSigner(IAsymmetricBlockCipher, IDigest, int)

Generate a signer with explicit trailer for ISO9796-2, scheme 2 or 3.

public Iso9796d2PssSigner(IAsymmetricBlockCipher cipher, IDigest digest, int saltLength)

Parameters

cipher IAsymmetricBlockCipher

base cipher to use for signature creation/verification

digest IDigest

digest to use.

saltLength int

length of salt in bytes.

Iso9796d2PssSigner(IAsymmetricBlockCipher, IDigest, int, bool)

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

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

Parameters

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.

Properties

AlgorithmName

The algorithm name.

public virtual string AlgorithmName { get; }

Property Value

string

Methods

BlockUpdate(byte[], int, int)

Update the signer with a block of bytes.

public virtual void BlockUpdate(byte[] input, int inOff, int inLen)

Parameters

input byte[]

the byte array containing the data.

inOff int

the offset into the byte array where the data starts.

inLen int

the length of the data.

BlockUpdate(ReadOnlySpan<byte>)

Update the signer with a span of bytes.

public virtual void BlockUpdate(ReadOnlySpan<byte> input)

Parameters

input ReadOnlySpan<byte>

the span containing the data.

GenerateSignature()

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

public virtual byte[] GenerateSignature()

Returns

byte[]

GetMaxSignatureSize()

public virtual int GetMaxSignatureSize()

Returns

int

GetRecoveredMessage()

Return a reference to the recoveredMessage message.

public byte[] GetRecoveredMessage()

Returns

byte[]

The full/partial recoveredMessage message.

See Also

HasFullMessage()

Return true if the full message was recoveredMessage.

public virtual bool HasFullMessage()

Returns

bool

true on full message recovery, false otherwise, or if not sure.

See Also

Init(bool, ICipherParameters)

Initialise the signer.

public virtual void Init(bool forSigning, ICipherParameters parameters)

Parameters

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.

Exceptions

ArgumentException

if wrong parameter type or a fixed salt is passed in which is the wrong length.

Reset()

reset the internal state

public virtual void Reset()

Update(byte)

update the internal digest with the byte b

public virtual void Update(byte input)

Parameters

input byte

UpdateWithRecoveredMessage(byte[])

Perform an update with the recovered message before adding any other data. This must be the first update method called, and calling it will result in the signer assuming that further calls to update will include message content past what is recoverable.

@param signature the signature that we are in the process of verifying. @throws IllegalStateException

public virtual void UpdateWithRecoveredMessage(byte[] signature)

Parameters

signature byte[]

VerifySignature(byte[])

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

public virtual bool VerifySignature(byte[] signature)

Parameters

signature byte[]

Returns

bool