Redigera

Dela via


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.

public:
 cli::array <System::Byte> ^ SignData(cli::array <System::Byte> ^ data);
public byte[] SignData (byte[] data);
override this.SignData : byte[] -> byte[]
member this.SignData : byte[] -> byte[]
Public Function SignData (data As Byte()) As Byte()

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

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.

public:
 cli::array <System::Byte> ^ SignData(System::IO::Stream ^ data);
public byte[] SignData (System.IO.Stream data);
[System.Security.SecurityCritical]
public byte[] SignData (System.IO.Stream data);
override this.SignData : System.IO.Stream -> byte[]
[<System.Security.SecurityCritical>]
member this.SignData : System.IO.Stream -> byte[]
member this.SignData : System.IO.Stream -> byte[]
Public Function SignData (data As Stream) As Byte()

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

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.

public:
 cli::array <System::Byte> ^ SignData(cli::array <System::Byte> ^ data, int offset, int count);
public byte[] SignData (byte[] data, int offset, int count);
[System.Security.SecurityCritical]
public byte[] SignData (byte[] data, int offset, int count);
override this.SignData : byte[] * int * int -> byte[]
[<System.Security.SecurityCritical>]
member this.SignData : byte[] * int * int -> byte[]
member this.SignData : byte[] * int * int -> byte[]
Public Function SignData (data As Byte(), offset As Integer, count As Integer) As Byte()

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