ECDsa.SignData 方法

定義

計算指定資料的雜湊值並進行簽署。

多載

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

使用指定的雜湊演算法,並簽署產生的雜湊值,來為指定的位元組陣列計算出雜湊值。

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 簽章。

例外狀況

datanull

hashAlgorithm.NamenullEmpty

適用於

SignData(Stream, HashAlgorithmName)

來源:
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 簽章。

例外狀況

datanull

hashAlgorithm.NamenullEmpty

適用於

SignData(ReadOnlySpan<Byte>, HashAlgorithmName)

來源:
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 簽章。

例外狀況

hashAlgorithmName是空字串。

hashAlgorithmNamenull 是 。

備註

這個方法會使用 IeeeP1363FixedFieldConcatenation 來編碼簽章。 若要使用不同的簽章格式,請使用 SignData(ReadOnlySpan<Byte>, HashAlgorithmName, DSASignatureFormat)

適用於

SignData(Byte[], HashAlgorithmName, DSASignatureFormat)

來源:
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 簽章。

例外狀況

datanull

signatureFormat 不是已知的格式。

hashAlgorithm 具有 null 或空白 Name

雜湊或簽署作業發生錯誤。

適用於

SignData(Stream, HashAlgorithmName, DSASignatureFormat)

來源:
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 簽章。

例外狀況

datanull

signatureFormat 不是已知的格式。

hashAlgorithm 具有 null 或空白 Name

雜湊或簽署作業發生錯誤。

適用於

SignData(ReadOnlySpan<Byte>, HashAlgorithmName, DSASignatureFormat)

來源:
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 簽章。

例外狀況

hashAlgorithmName是空字串。

hashAlgorithmNamenull 是 。

signatureFormat 不是已知的格式。

適用於

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

來源:
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 的總位元組數。

例外狀況

hashAlgorithmName是空字串。

-或-

中的 destination 緩衝區太小,無法保存簽章。

hashAlgorithmNamenull 是 。

備註

這個方法會使用 IeeeP1363FixedFieldConcatenation 來編碼簽章。 若要使用不同的簽章格式,請使用 SignData(ReadOnlySpan<Byte>, Span<Byte>, HashAlgorithmName, DSASignatureFormat)

適用於

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

來源:
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 簽章。

例外狀況

datanull

hashAlgorithm.NamenullEmpty

offset 小於零。

-或-

count 小於零。

-或-

offset + count - 1 產生的索引超出 data 上限。

適用於

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

來源:
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 的總位元組數。

例外狀況

hashAlgorithmName是空字串。

-或-

中的 destination 緩衝區太小,無法保存簽章。

hashAlgorithmNamenull 是 。

signatureFormat 不是已知的格式。

適用於

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

來源:
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 簽章。

例外狀況

datanull

signatureFormat 不是已知的格式。

-或-

offset 小於零。

-或-

count 小於零。

-或-

offset + count - 1 產生的索引超出 data 上限。

hashAlgorithm 具有 null 或空白 Name

雜湊或簽署作業發生錯誤。

適用於