<PackageReference Include="System.Security.Cryptography.Cng" Version="5.0.0" />

System.Security.Cryptography.ECDsaCng

public sealed class ECDsaCng : ECDsa
Provides a Cryptography Next Generation (CNG) implementation of the Elliptic Curve Digital Signature Algorithm (ECDSA).
public CngAlgorithm HashAlgorithm { get; set; }

Gets or sets the hash algorithm to use when signing and verifying data.

public CngKey Key { get; }

Gets or sets the key to use when signing and verifying data.

public ECDsaCng()

Initializes a new instance of the ECDsaCng class with a random key pair.

public ECDsaCng(int keySize)

Initializes a new instance of the ECDsaCng class with a specified target key size.

public ECDsaCng(CngKey key)

Initializes a new instance of the ECDsaCng class by using the specified CngKey object.

public void FromXmlString(string xml, ECKeyXmlFormat format)

Deserializes the key information from an XML string by using the specified format.

public byte[] SignData(byte[] data)

Generates a signature for the specified data.

public byte[] SignData(byte[] data, int offset, int count)

Generates a digital signature for the specified length of data, beginning at the specified offset.

public byte[] SignData(Stream data)

Generates a signature for the specified data stream, reading to the end of the stream.

public string ToXmlString(ECKeyXmlFormat format)

Serializes the key information to an XML string by using the specified format.

public bool VerifyData(byte[] data, byte[] signature)

Verifies the digital signature of the specified data.

public bool VerifyData(byte[] data, int offset, int count, byte[] signature)

Verifies a signature for the specified length of data, beginning at the specified offset.

public bool VerifyData(Stream data, byte[] signature)

Verifies the digital signature of the specified data stream, reading to the end of the stream.