Table of Contents

Class Iso9796d2Signer

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

ISO9796-2 - mechanism using a hash function with recovery (scheme 1)

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

Constructors

Iso9796d2Signer(IAsymmetricBlockCipher, IDigest)

Constructor for a signer with an explicit digest trailer.

public Iso9796d2Signer(IAsymmetricBlockCipher cipher, IDigest digest)

Parameters

cipher IAsymmetricBlockCipher

cipher to use.

digest IDigest

digest to sign with.

Iso9796d2Signer(IAsymmetricBlockCipher, IDigest, bool)

Generate a signer with either implicit or explicit trailers for ISO9796-2.

public Iso9796d2Signer(IAsymmetricBlockCipher cipher, IDigest digest, bool isImplicit)

Parameters

cipher IAsymmetricBlockCipher

base cipher to use for signature creation/verification

digest IDigest

digest to use.

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.

See Also

Init(bool, ICipherParameters)

Initialise the signer for signing or verification.

public virtual void Init(bool forSigning, ICipherParameters parameters)

Parameters

forSigning bool

true if for signing, false otherwise.

parameters ICipherParameters

necessary parameters.

Reset()

reset the internal state

public virtual void Reset()

Update(byte)

Update the signer with a single byte.

public virtual void Update(byte input)

Parameters

input byte

the input byte to be entered.

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