ECDsaCng.SignData Method

Definition

Generates a signature.

Overloads

SignData(Byte[])

Generates a signature for the specified data.

SignData(Stream)

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

SignData(Byte[], Int32, Int32)

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

SignData(Byte[])

Source:
Cng.NotSupported.cs
Source:
Cng.NotSupported.cs
Source:
Cng.NotSupported.cs

Generates a signature for the specified data.

C#
public byte[] SignData(byte[] data);

Parameters

data
Byte[]

The message data to be signed.

Returns

Byte[]

A digital signature for the specified data.

Exceptions

data is null.

The key information that is associated with the instance does not have a private key.

Remarks

This method generates a signature for the specified data by hashing the input data using the HashAlgorithm property, and then signing the result.

The KeyContainerPermissionFlags.Sign flag is required if the Cryptography Next Generation (CNG) key is not randomly generated by the ECDsaCng object.

Applies to

.NET 10 i druge verzije
Proizvod Verzije
.NET 6, 7, 8, 9, 10
.NET Framework 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided), 2.1 (package-provided)
Windows Desktop 3.0, 3.1, 5

SignData(Stream)

Source:
Cng.NotSupported.cs
Source:
Cng.NotSupported.cs
Source:
Cng.NotSupported.cs

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

C#
public byte[] SignData(System.IO.Stream data);
C#
[System.Security.SecurityCritical]
public byte[] SignData(System.IO.Stream data);

Parameters

data
Stream

The data stream to be signed.

Returns

Byte[]

A digital signature for the specified data stream.

Attributes

Exceptions

data is null.

The key information that is associated with the instance does not have a private key.

Remarks

This method generates a signature for the specified data stream by hashing the input data using the HashAlgorithm property, and then signing the result.

The KeyContainerPermissionFlags.Sign flag is required if the Cryptography Next Generation (CNG) key is not randomly generated by the ECDsaCng object.

Applies to

.NET 10 i druge verzije
Proizvod Verzije
.NET 6, 7, 8, 9, 10
.NET Framework 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided), 2.1 (package-provided)
Windows Desktop 3.0, 3.1, 5

SignData(Byte[], Int32, Int32)

Source:
Cng.NotSupported.cs
Source:
Cng.NotSupported.cs
Source:
Cng.NotSupported.cs

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

C#
public byte[] SignData(byte[] data, int offset, int count);
C#
[System.Security.SecurityCritical]
public byte[] SignData(byte[] data, int offset, int count);

Parameters

data
Byte[]

The message data to be signed.

offset
Int32

The location in the string at which to start signing.

count
Int32

The length of the string, in characters, following offset that will be signed.

Returns

Byte[]

A digital signature for the specified length of data.

Attributes

Exceptions

data is null.

count or offset caused reading outside the bounds of the data string.

The key information that is associated with the instance does not have a private key.

Remarks

This method generates a signature for the specified data by hashing the input data using the HashAlgorithm property, and then signing the result

The KeyContainerPermissionFlags.Sign flag is required if the Cryptography Next Generation (CNG) key is not randomly generated by the ECDsaCng object.

Applies to

.NET 10 i druge verzije
Proizvod Verzije
.NET 6, 7, 8, 9, 10
.NET Framework 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided), 2.1 (package-provided)
Windows Desktop 3.0, 3.1, 5