DSA.SignData 方法

定義

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

多載

SignData(Byte[], HashAlgorithmName)

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

SignData(Stream, HashAlgorithmName)

使用指定的雜湊演算法,並簽署產生的雜湊值,來為指定的資料流計算出雜湊值。

SignData(Byte[], HashAlgorithmName, DSASignatureFormat)

計算指定資料的雜湊值,並使用指定的簽章格式加以簽署。

SignData(Stream, HashAlgorithmName, DSASignatureFormat)

計算指定資料的雜湊值,並使用指定的簽章格式加以簽署。

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

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

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

計算指定資料的雜湊值,並使用指定的簽章格式加以簽署。

SignData(Byte[], HashAlgorithmName)

來源:
DSA.cs
來源:
DSA.cs
來源:
DSA.cs

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

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

參數

data
Byte[]

用來計算雜湊值的輸入資料。

hashAlgorithm
HashAlgorithmName

要用來建立雜湊值的雜湊演算法。

傳回

Byte[]

指定資料的 DSA 簽章。

例外狀況

datanull

hashAlgorithm.NamenullEmpty

適用於

SignData(Stream, HashAlgorithmName)

來源:
DSA.cs
來源:
DSA.cs
來源:
DSA.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[]

指定資料的 DSA 簽章。

例外狀況

datanull

hashAlgorithm.NamenullEmpty

適用於

SignData(Byte[], HashAlgorithmName, DSASignatureFormat)

來源:
DSA.cs
來源:
DSA.cs
來源:
DSA.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[]

指定資料的 DSA 簽章。

例外狀況

datanull

signatureFormat 不是已知的格式。

hashAlgorithm 具有 null 或空白 Name

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

適用於

SignData(Stream, HashAlgorithmName, DSASignatureFormat)

來源:
DSA.cs
來源:
DSA.cs
來源:
DSA.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[]

指定資料的 DSA 簽章。

例外狀況

datanull

signatureFormat 不是已知的格式。

hashAlgorithm 具有 null 或空白 Name

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

適用於

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

來源:
DSA.cs
來源:
DSA.cs
來源:
DSA.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[]

指定資料的 DSA 簽章。

例外狀況

datanull

hashAlgorithm.NamenullEmpty

offset 小於零。

-或-

count 小於零。

-或-

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

適用於

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

來源:
DSA.cs
來源:
DSA.cs
來源:
DSA.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[]

指定資料的 DSA 簽章。

例外狀況

datanull

signatureFormat 不是已知的格式。

-或- offset 小於零。

-或- count 小於零。

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

hashAlgorithm 具有 null 或空白 Name

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

適用於