語言

ECDsa.SignData 方法

定義

計算指定資料的雜湊值並簽名。

多載

名稱 Description
SignData(Byte[], HashAlgorithmName)

利用指定的雜湊演算法計算指定位元組陣列的雜湊值,並對所得雜湊值進行簽名。

SignData(Stream, HashAlgorithmName)

利用指定的雜湊演算法計算指定串流的雜湊值,並對所得雜湊值進行簽名。

SignData(ReadOnlySpan<Byte>, HashAlgorithmName)

計算指定資料的雜湊值並簽名。

SignData(Byte[], HashAlgorithmName, DSASignatureFormat)

計算指定資料的雜湊值,並以指定的簽章格式進行簽名。

SignData(Stream, HashAlgorithmName, DSASignatureFormat)

計算指定資料的雜湊值,並以指定的簽章格式進行簽名。

SignData(ReadOnlySpan<Byte>, HashAlgorithmName, DSASignatureFormat)

計算指定資料的雜湊值,並以指定的簽章格式進行簽名。

SignData(ReadOnlySpan<Byte>, Span<Byte>, HashAlgorithmName)

計算指定資料的雜湊值,並以指定格式將其登錄到提供的緩衝區。

SignData(Byte[], Int32, Int32, HashAlgorithmName)

利用指定的雜湊演算法計算指定位元組陣列中某部分的雜湊值,並對所得雜湊值進行簽名。

SignData(ReadOnlySpan<Byte>, Span<Byte>, HashAlgorithmName, DSASignatureFormat)

計算指定資料的雜湊值,並以指定格式將其登錄到提供的緩衝區。

SignData(Byte[], Int32, Int32, HashAlgorithmName, DSASignatureFormat)

計算指定資料的雜湊值,並以指定的簽章格式進行簽名。

SignData(Byte[], HashAlgorithmName)

來源:
ECDsa.cs
來源:
ECDsa.cs
來源:
ECDsa.cs
來源:
ECDsa.cs
來源:
ECDsa.cs

利用指定的雜湊演算法計算指定位元組陣列的雜湊值,並對所得雜湊值進行簽名。

public:
 virtual cli::array <System::Byte> ^ SignData(cli::array <System::Byte> ^ data, System::Security::Cryptography::HashAlgorithmName hashAlgorithm);
public virtual byte[] SignData(byte[] data, System.Security.Cryptography.HashAlgorithmName hashAlgorithm);
abstract member SignData : byte[] * System.Security.Cryptography.HashAlgorithmName -> byte[]
override this.SignData : byte[] * System.Security.Cryptography.HashAlgorithmName -> byte[]
Public Overridable Function SignData (data As Byte(), hashAlgorithm As HashAlgorithmName) As Byte()

參數

data
Byte[]

輸入資料,用以計算雜湊值。

hashAlgorithm
HashAlgorithmName

用來產生雜湊值的雜湊演算法。

傳回

Byte[]

指定資料的 ECDSA 簽名。

例外狀況

data 是 null。

hashAlgorithm。Name 是 null 或 Empty。

適用於

SignData(Stream, HashAlgorithmName)

來源:
ECDsa.cs
來源:
ECDsa.cs
來源:
ECDsa.cs
來源:
ECDsa.cs
來源:
ECDsa.cs

利用指定的雜湊演算法計算指定串流的雜湊值,並對所得雜湊值進行簽名。

public:
 virtual cli::array <System::Byte> ^ SignData(System::IO::Stream ^ data, System::Security::Cryptography::HashAlgorithmName hashAlgorithm);
public virtual byte[] SignData(System.IO.Stream data, System.Security.Cryptography.HashAlgorithmName hashAlgorithm);
abstract member SignData : System.IO.Stream * System.Security.Cryptography.HashAlgorithmName -> byte[]
override this.SignData : System.IO.Stream * System.Security.Cryptography.HashAlgorithmName -> byte[]
Public Overridable Function SignData (data As Stream, hashAlgorithm As HashAlgorithmName) As Byte()

參數

data
Stream

計算雜湊值的輸入串流。

hashAlgorithm
HashAlgorithmName

用來產生雜湊值的雜湊演算法。

傳回

Byte[]

指定資料的 ECDSA 簽名。

例外狀況

data 是 null。

hashAlgorithm。Name 是 null 或 Empty。

適用於

SignData(ReadOnlySpan<Byte>, HashAlgorithmName)

來源:
ECDsa.cs
來源:
ECDsa.cs
來源:
ECDsa.cs
來源:
ECDsa.cs
來源:
ECDsa.cs

計算指定資料的雜湊值並簽名。

public:
 cli::array <System::Byte> ^ SignData(ReadOnlySpan<System::Byte> data, System::Security::Cryptography::HashAlgorithmName hashAlgorithm);
public byte[] SignData(ReadOnlySpan<byte> data, System.Security.Cryptography.HashAlgorithmName hashAlgorithm);
member this.SignData : ReadOnlySpan<byte> * System.Security.Cryptography.HashAlgorithmName -> byte[]
Public Function SignData (data As ReadOnlySpan(Of Byte), hashAlgorithm As HashAlgorithmName) As Byte()

參數

data
ReadOnlySpan<Byte>

數據需要雜湊和簽名。

hashAlgorithm
HashAlgorithmName

用來產生雜湊值的雜湊演算法。

傳回

Byte[]

指定資料的 ECDSA 簽名。

例外狀況

hashAlgorithm是 Name 空字串。

hashAlgorithm的 Name 是 null。

備註

此方法將用於 IeeeP1363FixedFieldConcatenation 編碼簽名。 若要使用不同的簽章格式,請使用 SignData(ReadOnlySpan<Byte>, HashAlgorithmName, DSASignatureFormat)。

另請參閱

適用於

SignData(Byte[], HashAlgorithmName, DSASignatureFormat)

來源:
ECDsa.cs
來源:
ECDsa.cs
來源:
ECDsa.cs
來源:
ECDsa.cs
來源:
ECDsa.cs

計算指定資料的雜湊值,並以指定的簽章格式進行簽名。

public:
 cli::array <System::Byte> ^ SignData(cli::array <System::Byte> ^ data, System::Security::Cryptography::HashAlgorithmName hashAlgorithm, System::Security::Cryptography::DSASignatureFormat signatureFormat);
public byte[] SignData(byte[] data, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, System.Security.Cryptography.DSASignatureFormat signatureFormat);
member this.SignData : byte[] * System.Security.Cryptography.HashAlgorithmName * System.Security.Cryptography.DSASignatureFormat -> byte[]
Public Function SignData (data As Byte(), hashAlgorithm As HashAlgorithmName, signatureFormat As DSASignatureFormat) As Byte()

參數

data
Byte[]

要簽署的數據。

hashAlgorithm
HashAlgorithmName

用來產生雜湊值的雜湊演算法。

signatureFormat
DSASignatureFormat

簽名的編碼格式。

傳回

Byte[]

指定資料的 ECDSA 簽名。

例外狀況

data 是 null。

signatureFormat 不是一個已知的格式。

hashAlgorithm有 a null 或 空。Name

雜湊或簽名操作發生錯誤。

適用於

SignData(Stream, HashAlgorithmName, DSASignatureFormat)

來源:
ECDsa.cs
來源:
ECDsa.cs
來源:
ECDsa.cs
來源:
ECDsa.cs
來源:
ECDsa.cs

計算指定資料的雜湊值,並以指定的簽章格式進行簽名。

public:
 cli::array <System::Byte> ^ SignData(System::IO::Stream ^ data, System::Security::Cryptography::HashAlgorithmName hashAlgorithm, System::Security::Cryptography::DSASignatureFormat signatureFormat);
public byte[] SignData(System.IO.Stream data, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, System.Security.Cryptography.DSASignatureFormat signatureFormat);
member this.SignData : System.IO.Stream * System.Security.Cryptography.HashAlgorithmName * System.Security.Cryptography.DSASignatureFormat -> byte[]
Public Function SignData (data As Stream, hashAlgorithm As HashAlgorithmName, signatureFormat As DSASignatureFormat) As Byte()

參數

data
Stream

要簽署的數據。

hashAlgorithm
HashAlgorithmName

用來產生雜湊值的雜湊演算法。

signatureFormat
DSASignatureFormat

簽名的編碼格式。

傳回

Byte[]

指定資料的 ECDSA 簽名。

例外狀況

data 是 null。

signatureFormat 不是一個已知的格式。

hashAlgorithm有 a null 或 空。Name

雜湊或簽名操作發生錯誤。

適用於

SignData(ReadOnlySpan<Byte>, HashAlgorithmName, DSASignatureFormat)

來源:
ECDsa.cs
來源:
ECDsa.cs
來源:
ECDsa.cs
來源:
ECDsa.cs
來源:
ECDsa.cs

計算指定資料的雜湊值,並以指定的簽章格式進行簽名。

public:
 cli::array <System::Byte> ^ SignData(ReadOnlySpan<System::Byte> data, System::Security::Cryptography::HashAlgorithmName hashAlgorithm, System::Security::Cryptography::DSASignatureFormat signatureFormat);
public byte[] SignData(ReadOnlySpan<byte> data, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, System.Security.Cryptography.DSASignatureFormat signatureFormat);
member this.SignData : ReadOnlySpan<byte> * System.Security.Cryptography.HashAlgorithmName * System.Security.Cryptography.DSASignatureFormat -> byte[]
Public Function SignData (data As ReadOnlySpan(Of Byte), hashAlgorithm As HashAlgorithmName, signatureFormat As DSASignatureFormat) As Byte()

參數

data
ReadOnlySpan<Byte>

數據需要雜湊和簽名。

hashAlgorithm
HashAlgorithmName

用來產生雜湊值的雜湊演算法。

signatureFormat
DSASignatureFormat

簽名的編碼格式。

傳回

Byte[]

指定資料的 ECDSA 簽名。

例外狀況

hashAlgorithm是 Name 空字串。

hashAlgorithm的 Name 是 null。

signatureFormat 不是一個已知的格式。

另請參閱

適用於

SignData(ReadOnlySpan<Byte>, Span<Byte>, HashAlgorithmName)

來源:
ECDsa.cs
來源:
ECDsa.cs
來源:
ECDsa.cs
來源:
ECDsa.cs
來源:
ECDsa.cs

計算指定資料的雜湊值,並以指定格式將其登錄到提供的緩衝區。

public:
 int SignData(ReadOnlySpan<System::Byte> data, Span<System::Byte> destination, System::Security::Cryptography::HashAlgorithmName hashAlgorithm);
public int SignData(ReadOnlySpan<byte> data, Span<byte> destination, System.Security.Cryptography.HashAlgorithmName hashAlgorithm);
member this.SignData : ReadOnlySpan<byte> * Span<byte> * System.Security.Cryptography.HashAlgorithmName -> int
Public Function SignData (data As ReadOnlySpan(Of Byte), destination As Span(Of Byte), hashAlgorithm As HashAlgorithmName) As Integer

參數

data
ReadOnlySpan<Byte>

數據需要雜湊和簽名。

destination
Span<Byte>

接收簽名的緩衝區。

hashAlgorithm
HashAlgorithmName

用來產生雜湊值的雜湊演算法。

傳回

寫入 destination的總位元組數。

例外狀況

hashAlgorithm是 Name 空字串。

-或-

緩 destination 衝區太小,無法儲存簽名。

hashAlgorithm的 Name 是 null。

備註

此方法將用於 IeeeP1363FixedFieldConcatenation 編碼簽名。 若要使用不同的簽章格式,請使用 SignData(ReadOnlySpan<Byte>, Span<Byte>, HashAlgorithmName, DSASignatureFormat)。

另請參閱

適用於

SignData(Byte[], Int32, Int32, HashAlgorithmName)

來源:
ECDsa.cs
來源:
ECDsa.cs
來源:
ECDsa.cs
來源:
ECDsa.cs
來源:
ECDsa.cs

利用指定的雜湊演算法計算指定位元組陣列中某部分的雜湊值,並對所得雜湊值進行簽名。

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

參數

data
Byte[]

輸入資料,用以計算雜湊值。

offset
Int32

從陣列開始使用資料的偏移量。

count
Int32

陣列中可用作資料的位元組數。

hashAlgorithm
HashAlgorithmName

用來產生雜湊值的雜湊演算法。

傳回

Byte[]

指定資料的 ECDSA 簽名。

例外狀況

data 是 null。

hashAlgorithm。Name 是 null 或 Empty。

offset 小於零。

-或-

count 小於零。

-或-

offset + count - 1 使得一個指標超過的 data上界。

適用於

SignData(ReadOnlySpan<Byte>, Span<Byte>, HashAlgorithmName, DSASignatureFormat)

來源:
ECDsa.cs
來源:
ECDsa.cs
來源:
ECDsa.cs
來源:
ECDsa.cs
來源:
ECDsa.cs

計算指定資料的雜湊值,並以指定格式將其登錄到提供的緩衝區。

public:
 int SignData(ReadOnlySpan<System::Byte> data, Span<System::Byte> destination, System::Security::Cryptography::HashAlgorithmName hashAlgorithm, System::Security::Cryptography::DSASignatureFormat signatureFormat);
public int SignData(ReadOnlySpan<byte> data, Span<byte> destination, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, System.Security.Cryptography.DSASignatureFormat signatureFormat);
member this.SignData : ReadOnlySpan<byte> * Span<byte> * System.Security.Cryptography.HashAlgorithmName * System.Security.Cryptography.DSASignatureFormat -> int
Public Function SignData (data As ReadOnlySpan(Of Byte), destination As Span(Of Byte), hashAlgorithm As HashAlgorithmName, signatureFormat As DSASignatureFormat) As Integer

參數

data
ReadOnlySpan<Byte>

數據需要雜湊和簽名。

destination
Span<Byte>

接收簽名的緩衝區。

hashAlgorithm
HashAlgorithmName

用來產生雜湊值的雜湊演算法。

signatureFormat
DSASignatureFormat

簽名的編碼格式。

傳回

寫入 destination的總位元組數。

例外狀況

hashAlgorithm是 Name 空字串。

-或-

緩 destination 衝區太小,無法儲存簽名。

hashAlgorithm的 Name 是 null。

signatureFormat 不是一個已知的格式。

另請參閱

適用於

SignData(Byte[], Int32, Int32, HashAlgorithmName, DSASignatureFormat)

來源:
ECDsa.cs
來源:
ECDsa.cs
來源:
ECDsa.cs
來源:
ECDsa.cs
來源:
ECDsa.cs

計算指定資料的雜湊值,並以指定的簽章格式進行簽名。

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

參數

data
Byte[]

要簽署的數據。

offset
Int32

從哪裡開始雜湊的偏移 data 量。

count
Int32

從 中讀取 data的位元組數。

hashAlgorithm
HashAlgorithmName

用來產生雜湊值的雜湊演算法。

signatureFormat
DSASignatureFormat

簽名的編碼格式。

傳回

Byte[]

指定資料的 ECDSA 簽名。

例外狀況

data 是 null。

signatureFormat 不是一個已知的格式。

-或-

offset 小於零。

-或-

count 小於零。

-或-

offset + count - 1 使得一個指標超過的 data上界。

hashAlgorithm有 a null 或 空。Name

雜湊或簽名操作發生錯誤。

適用於