Class Gost3410Algorithm
Represents the abstract class from which asymmetric algorithms can
inherit.
Inheritance
Gost3410Algorithm
Assembly: CryptoPro.Security.Cryptography.dll
Syntax
public abstract class Gost3410Algorithm : AsymmetricAlgorithm, IDisposable
Properties
HashAlgorithmName
Gets or sets the hash algorithm to use when signing and verifying
data.
Declaration
protected abstract CpHashAlgorithmName HashAlgorithmName { get; }
Property Value
HashSizeInBytes
Gets the hash value size in bytes.
Declaration
protected abstract int HashSizeInBytes { get; }
Property Value
KeySize
Gets or sets the size, in bits, of the key modulus used by the asymmetric algorithm.
Declaration
public override sealed int KeySize { get; set; }
Property Value
Type |
Description |
int |
The size, in bits, of the key modulus used by the asymmetric algorithm.
|
Overrides
Exceptions
KeySizeInBits
Gets the key size in bits.
Declaration
protected abstract int KeySizeInBits { get; }
Property Value
LegalKeySizes
Gets the key sizes that are supported by the asymmetric algorithm.
Declaration
public override sealed KeySizes[] LegalKeySizes { get; }
Property Value
Type |
Description |
KeySizes[] |
An array that contains the key sizes supported by the asymmetric algorithm.
|
Overrides
SignatureSizeInBytes
Gets the signature value size in bytes.
Declaration
protected virtual int SignatureSizeInBytes { get; }
Property Value
Methods
CreateAgree(Gost3410Parameters)
Declaration
public abstract GostSharedSecretAlgorithm CreateAgree(Gost3410Parameters alg)
Parameters
Returns
HashData(byte[], int, int)
Declaration
protected virtual byte[] HashData(byte[] data, int offset, int count)
Parameters
Type |
Name |
Description |
byte[] |
data |
|
int |
offset |
|
int |
count |
|
Returns
HashData(Stream)
Declaration
protected virtual byte[] HashData(Stream data)
Parameters
Type |
Name |
Description |
Stream |
data |
|
Returns
ImportPublicKey(ReadOnlySpan<byte>, ReadOnlySpan<byte>)
Imports encoded public key.
Declaration
public abstract void ImportPublicKey(ReadOnlySpan<byte> encodedPublicKey, ReadOnlySpan<byte> encodedParameters)
Parameters
SignData(byte[])
Declaration
public virtual byte[] SignData(byte[] data)
Parameters
Type |
Name |
Description |
byte[] |
data |
|
Returns
SignData(byte[], int, int)
Declaration
public virtual byte[] SignData(byte[] data, int offset, int count)
Parameters
Type |
Name |
Description |
byte[] |
data |
|
int |
offset |
|
int |
count |
|
Returns
SignData(Stream)
Declaration
public virtual byte[] SignData(Stream data)
Parameters
Type |
Name |
Description |
Stream |
data |
|
Returns
SignData(ReadOnlySpan<byte>)
Declaration
public virtual byte[] SignData(ReadOnlySpan<byte> data)
Parameters
Returns
SignData(ReadOnlySpan<byte>, Span<byte>)
Computes the hash value of the specified data and signs it in the
indicated format into the provided buffer.
Declaration
public virtual int SignData(ReadOnlySpan<byte> data, Span<byte> destination)
Parameters
Type |
Name |
Description |
ReadOnlySpan<byte> |
data |
The data to hash and sign.
|
Span<byte> |
destination |
The buffer to receive the signature.
|
Returns
Type |
Description |
int |
The total number of bytes written to destination .
|
Exceptions
Type |
Condition |
ArgumentException |
The buffer in destination is too small to hold
the signature.
|
SignDataCore(ReadOnlySpan<byte>)
Declaration
protected virtual byte[] SignDataCore(ReadOnlySpan<byte> data)
Parameters
Returns
SignHash(byte[])
Declaration
public virtual byte[] SignHash(byte[] hash)
Parameters
Type |
Name |
Description |
byte[] |
hash |
|
Returns
SignHash(ReadOnlySpan<byte>)
Declaration
public virtual byte[] SignHash(ReadOnlySpan<byte> hash)
Parameters
Returns
SignHash(ReadOnlySpan<byte>, Span<byte>)
Declaration
public virtual int SignHash(ReadOnlySpan<byte> hash, Span<byte> destination)
Parameters
Returns
SignHashCore(ReadOnlySpan<byte>)
Computes the ECDSA signature for the specified hash value in the
indicated format.
Declaration
protected virtual byte[] SignHashCore(ReadOnlySpan<byte> hash)
Parameters
Returns
Type |
Description |
byte[] |
The ECDSA signature for the specified data.
|
Exceptions
TryHashData(ReadOnlySpan<byte>, Span<byte>, out int)
Declaration
protected virtual bool TryHashData(ReadOnlySpan<byte> data, Span<byte> destination, out int bytesWritten)
Parameters
Returns
TrySignData(ReadOnlySpan<byte>, Span<byte>, out int)
Declaration
public virtual bool TrySignData(ReadOnlySpan<byte> data, Span<byte> destination, out int bytesWritten)
Parameters
Returns
TrySignDataCore(ReadOnlySpan<byte>, Span<byte>, out int)
Attempts to create the ECDSA signature for the specified data in the
indicated format into the provided buffer.
Declaration
protected virtual bool TrySignDataCore(ReadOnlySpan<byte> data, Span<byte> destination, out int bytesWritten)
Parameters
Type |
Name |
Description |
ReadOnlySpan<byte> |
data |
The data to hash and sign.
|
Span<byte> |
destination |
The buffer to receive the signature.
|
int |
bytesWritten |
When this method returns, contains a value that indicates the number
of bytes written to destination . This parameter
is treated as uninitialized.
|
Returns
Type |
Description |
bool |
true if destination is big
enough to receive the signature; otherwise, false.
|
Exceptions
TrySignHash(ReadOnlySpan<byte>, Span<byte>, out int)
Declaration
public virtual bool TrySignHash(ReadOnlySpan<byte> hash, Span<byte> destination, out int bytesWritten)
Parameters
Returns
TrySignHashCore(ReadOnlySpan<byte>, Span<byte>, out int)
Attempts to create the ECDSA signature for the specified hash value
in the indicated format into the provided buffer.
Declaration
protected abstract bool TrySignHashCore(ReadOnlySpan<byte> hash, Span<byte> destination, out int bytesWritten)
Parameters
Type |
Name |
Description |
ReadOnlySpan<byte> |
hash |
The hash value to sign.
|
Span<byte> |
destination |
The buffer to receive the signature.
|
int |
bytesWritten |
When this method returns, contains a value that indicates the number
of bytes written to destination . This parameter
is treated as uninitialized.
|
Returns
Type |
Description |
bool |
true if destination is big
enough to receive the signature; otherwise, false.
|
Exceptions
VerifyData(byte[], byte[])
Declaration
public virtual bool VerifyData(byte[] data, byte[] signature)
Parameters
Type |
Name |
Description |
byte[] |
data |
|
byte[] |
signature |
|
Returns
VerifyData(byte[], int, int, byte[])
Declaration
public virtual bool VerifyData(byte[] data, int offset, int count, byte[] signature)
Parameters
Type |
Name |
Description |
byte[] |
data |
|
int |
offset |
|
int |
count |
|
byte[] |
signature |
|
Returns
VerifyData(Stream, byte[])
Declaration
public virtual bool VerifyData(Stream data, byte[] signature)
Parameters
Type |
Name |
Description |
Stream |
data |
|
byte[] |
signature |
|
Returns
VerifyData(ReadOnlySpan<byte>, ReadOnlySpan<byte>)
Declaration
public virtual bool VerifyData(ReadOnlySpan<byte> data, ReadOnlySpan<byte> signature)
Parameters
Returns
VerifyDataCore(Stream, ReadOnlySpan<byte>)
Verifies that a digital signature is valid for the provided data.
Declaration
protected virtual bool VerifyDataCore(Stream data, ReadOnlySpan<byte> signature)
Parameters
Returns
Type |
Description |
bool |
true if the digital signature is valid for the
provided data; otherwise, false.
|
Exceptions
VerifyDataCore(ReadOnlySpan<byte>, ReadOnlySpan<byte>)
Verifies that a digital signature is valid for the provided data.
Declaration
protected virtual bool VerifyDataCore(ReadOnlySpan<byte> data, ReadOnlySpan<byte> signature)
Parameters
Returns
Type |
Description |
bool |
true if the digital signature is valid for the
provided data; otherwise, false.
|
Exceptions
VerifyHash(byte[], byte[])
Declaration
public virtual bool VerifyHash(byte[] hash, byte[] signature)
Parameters
Type |
Name |
Description |
byte[] |
hash |
|
byte[] |
signature |
|
Returns
VerifyHash(ReadOnlySpan<byte>, ReadOnlySpan<byte>)
Declaration
public virtual bool VerifyHash(ReadOnlySpan<byte> hash, ReadOnlySpan<byte> signature)
Parameters
Returns
VerifyHashCore(ReadOnlySpan<byte>, ReadOnlySpan<byte>)
Verifies that a digital signature is valid for the provided hash.
Declaration
protected abstract bool VerifyHashCore(ReadOnlySpan<byte> hash, ReadOnlySpan<byte> signature)
Parameters
Returns
Type |
Description |
bool |
true if the digital signature is valid for the
provided data; otherwise, false.
|
Exceptions
Implements