DSACng DSACng DSACng DSACng Class

Definition

Provides a Cryptography Next Generation (CNG) implementation of the Digital Signature Algorithm (DSA).

public ref class DSACng sealed : System::Security::Cryptography::DSA
public sealed class DSACng : System.Security.Cryptography.DSA
type DSACng = class
    inherit DSA
Public NotInheritable Class DSACng
Inherits DSA
Inheritance

Constructors

DSACng() DSACng() DSACng() DSACng()

Initializes a new instance of the DSACng class with a random 2,048-bit key pair.

DSACng(CngKey) DSACng(CngKey) DSACng(CngKey) DSACng(CngKey)

Initializes a new instance of the DSACng class with the specified key.

DSACng(Int32) DSACng(Int32) DSACng(Int32) DSACng(Int32)

Initializes a new instance of the DSACng class with a randomly generated key of the specified size.

Properties

Key Key Key Key

Gets the key that will be used by the DSACng object for any cryptographic operation that it performs.

KeyExchangeAlgorithm KeyExchangeAlgorithm KeyExchangeAlgorithm KeyExchangeAlgorithm

Gets the name of the key exchange algorithm.

KeySize KeySize KeySize KeySize

Gets or sets the size, in bits, of the key modulus used by the asymmetric algorithm.

(Inherited from AsymmetricAlgorithm)
LegalKeySizes LegalKeySizes LegalKeySizes LegalKeySizes

Gets the key sizes, in bits, that are supported by the DSA algorithm.

SignatureAlgorithm SignatureAlgorithm SignatureAlgorithm SignatureAlgorithm

Gets the name of the signature algorithm.

Methods

Clear() Clear() Clear() Clear()

Releases all resources used by the AsymmetricAlgorithm class.

(Inherited from AsymmetricAlgorithm)
CreateSignature(Byte[]) CreateSignature(Byte[]) CreateSignature(Byte[]) CreateSignature(Byte[])

Creates the digital signature for the specified data.

Dispose() Dispose() Dispose() Dispose()

Releases all resources used by the current instance of the AsymmetricAlgorithm class.

(Inherited from AsymmetricAlgorithm)
Dispose(Boolean) Dispose(Boolean) Dispose(Boolean) Dispose(Boolean)

Releases the unmanaged resources used by the AsymmetricAlgorithm class and optionally releases the managed resources.

(Inherited from AsymmetricAlgorithm)
Equals(Object) Equals(Object) Equals(Object) Equals(Object)

Determines whether the specified object is equal to the current object.

(Inherited from Object)
ExportParameters(Boolean) ExportParameters(Boolean) ExportParameters(Boolean) ExportParameters(Boolean)

Exports the DSA algorithm parameters.

FromXmlString(String) FromXmlString(String) FromXmlString(String) FromXmlString(String)

Reconstructs a DSA object from an XML string.

(Inherited from DSA)
GetHashCode() GetHashCode() GetHashCode() GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetType() GetType() GetType() GetType()

Gets the Type of the current instance.

(Inherited from Object)
HashData(Byte[], Int32, Int32, HashAlgorithmName) HashData(Byte[], Int32, Int32, HashAlgorithmName) HashData(Byte[], Int32, Int32, HashAlgorithmName) HashData(Byte[], Int32, Int32, HashAlgorithmName)

When overridden in a derived class, computes the hash value of a specified portion of a byte array by using a specified hashing algorithm.

(Inherited from DSA)
HashData(Stream, HashAlgorithmName) HashData(Stream, HashAlgorithmName) HashData(Stream, HashAlgorithmName) HashData(Stream, HashAlgorithmName)

When overridden in a derived class, computes the hash value of a specified binary stream by using a specified hashing algorithm.

(Inherited from DSA)
ImportParameters(DSAParameters) ImportParameters(DSAParameters) ImportParameters(DSAParameters) ImportParameters(DSAParameters)

Replaces the existing key that the current instance is working with by creating a new CngKey for the parameters structure.

MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
SignData(Byte[], HashAlgorithmName) SignData(Byte[], HashAlgorithmName) SignData(Byte[], HashAlgorithmName) SignData(Byte[], HashAlgorithmName)

Computes the hash value of the specified byte array using the specified hash algorithm and signs the resulting hash value.

(Inherited from DSA)
SignData(Byte[], Int32, Int32, HashAlgorithmName) SignData(Byte[], Int32, Int32, HashAlgorithmName) SignData(Byte[], Int32, Int32, HashAlgorithmName) SignData(Byte[], Int32, Int32, HashAlgorithmName)

Computes the hash value of a portion of the specified byte array using the specified hash algorithm and signs the resulting hash value.

(Inherited from DSA)
SignData(Stream, HashAlgorithmName) SignData(Stream, HashAlgorithmName) SignData(Stream, HashAlgorithmName) SignData(Stream, HashAlgorithmName)

Computes the hash value of the specified stream using the specified hash algorithm and signs the resulting hash value.

(Inherited from DSA)
ToString() ToString() ToString() ToString()

Returns a string that represents the current object.

(Inherited from Object)
ToXmlString(Boolean) ToXmlString(Boolean) ToXmlString(Boolean) ToXmlString(Boolean)

Creates and returns an XML string representation of the current DSA object.

(Inherited from DSA)
TryCreateSignature(ReadOnlySpan<Byte>, Span<Byte>, Int32) TryCreateSignature(ReadOnlySpan<Byte>, Span<Byte>, Int32) TryCreateSignature(ReadOnlySpan<Byte>, Span<Byte>, Int32) TryCreateSignature(ReadOnlySpan<Byte>, Span<Byte>, Int32) Inherited from DSA
TryHashData(ReadOnlySpan<Byte>, Span<Byte>, HashAlgorithmName, Int32) TryHashData(ReadOnlySpan<Byte>, Span<Byte>, HashAlgorithmName, Int32) TryHashData(ReadOnlySpan<Byte>, Span<Byte>, HashAlgorithmName, Int32) TryHashData(ReadOnlySpan<Byte>, Span<Byte>, HashAlgorithmName, Int32) Inherited from DSA
TrySignData(ReadOnlySpan<Byte>, Span<Byte>, HashAlgorithmName, Int32) TrySignData(ReadOnlySpan<Byte>, Span<Byte>, HashAlgorithmName, Int32) TrySignData(ReadOnlySpan<Byte>, Span<Byte>, HashAlgorithmName, Int32) TrySignData(ReadOnlySpan<Byte>, Span<Byte>, HashAlgorithmName, Int32) Inherited from DSA
VerifyData(Byte[], Byte[], HashAlgorithmName) VerifyData(Byte[], Byte[], HashAlgorithmName) VerifyData(Byte[], Byte[], HashAlgorithmName) VerifyData(Byte[], Byte[], HashAlgorithmName)

Verifies that a digital signature is valid by calculating the hash value of the specified data using the specified hash algorithm and comparing it to the provided signature.

(Inherited from DSA)
VerifyData(Byte[], Int32, Int32, Byte[], HashAlgorithmName) VerifyData(Byte[], Int32, Int32, Byte[], HashAlgorithmName) VerifyData(Byte[], Int32, Int32, Byte[], HashAlgorithmName) VerifyData(Byte[], Int32, Int32, Byte[], HashAlgorithmName)

Verifies that a digital signature is valid by calculating the hash value of the data in a portion of a byte array using the specified hash algorithm and comparing it to the provided signature.

(Inherited from DSA)
VerifyData(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>, HashAlgorithmName) VerifyData(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>, HashAlgorithmName) VerifyData(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>, HashAlgorithmName) VerifyData(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>, HashAlgorithmName) Inherited from DSA
VerifyData(Stream, Byte[], HashAlgorithmName) VerifyData(Stream, Byte[], HashAlgorithmName) VerifyData(Stream, Byte[], HashAlgorithmName) VerifyData(Stream, Byte[], HashAlgorithmName)

Verifies that a digital signature is valid by calculating the hash value of the specified stream using the specified hash algorithm and comparing it to the provided signature.

(Inherited from DSA)
VerifySignature(Byte[], Byte[]) VerifySignature(Byte[], Byte[]) VerifySignature(Byte[], Byte[]) VerifySignature(Byte[], Byte[])

Verifies if the specified digital signature matches the specified data.

VerifySignature(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>) VerifySignature(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>) VerifySignature(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>) VerifySignature(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>) Inherited from DSA

Fields

KeySizeValue KeySizeValue KeySizeValue KeySizeValue

Represents the size, in bits, of the key modulus used by the asymmetric algorithm.

(Inherited from AsymmetricAlgorithm)
LegalKeySizesValue LegalKeySizesValue LegalKeySizesValue LegalKeySizesValue

Specifies the key sizes that are supported by the asymmetric algorithm.

(Inherited from AsymmetricAlgorithm)

Explicit Interface Implementations

IDisposable.Dispose() IDisposable.Dispose() IDisposable.Dispose() IDisposable.Dispose() Inherited from AsymmetricAlgorithm

Applies to