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
cipherIAsymmetricBlockCiphercipher to use.
digestIDigestdigest 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
cipherIAsymmetricBlockCipherbase cipher to use for signature creation/verification
digestIDigestdigest to use.
isImplicitboolwhether or not the trailer is implicit or gives the hash.
Properties
AlgorithmName
The algorithm name.
public virtual string AlgorithmName { get; }
Property Value
Methods
BlockUpdate(byte[], int, int)
Update the signer with a block of bytes.
public virtual void BlockUpdate(byte[] input, int inOff, int inLen)
Parameters
inputbyte[]the byte array containing the data.
inOffintthe offset into the byte array where the data starts.
inLenintthe length of the data.
BlockUpdate(ReadOnlySpan<byte>)
Update the signer with a span of bytes.
public virtual void BlockUpdate(ReadOnlySpan<byte> input)
Parameters
inputReadOnlySpan<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
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
forSigningbooltrue if for signing, false otherwise.
parametersICipherParametersnecessary 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
inputbytethe 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
signaturebyte[]
VerifySignature(byte[])
return true if the signature represents a ISO9796-2 signature for the passed in message.
public virtual bool VerifySignature(byte[] signature)
Parameters
signaturebyte[]