語言

RSA.SignData 方法

定義

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

多載

名稱 Description
SignData(Byte[], HashAlgorithmName, RSASignaturePadding)

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

SignData(Stream, HashAlgorithmName, RSASignaturePadding)

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

SignData(ReadOnlySpan<Byte>, HashAlgorithmName, RSASignaturePadding)

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

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

利用指定演算法計算所提供資料的雜湊值,並以當前金鑰簽署雜湊值,將簽章寫入提供的緩衝區。

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

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

SignData(Byte[], HashAlgorithmName, RSASignaturePadding)

來源:
RSA.cs
來源:
RSA.cs
來源:
RSA.cs
來源:
RSA.cs
來源:
RSA.cs

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

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

參數

data
Byte[]

輸入資料要雜湊和簽名。

hashAlgorithm
HashAlgorithmName

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

padding
RSASignaturePadding

填充模式。

傳回

Byte[]

指定資料的 RSA 簽名。

例外狀況

data 是 null。

-或-

padding 是 null。

hashAlgorithm。Name 是 null 或 Empty。

padding 未知,或此實作不支援。

-或-

此實例僅代表公鑰。

-或-

建立簽名時發生錯誤。

另請參閱

適用於

SignData(Stream, HashAlgorithmName, RSASignaturePadding)

來源:
RSA.cs
來源:
RSA.cs
來源:
RSA.cs
來源:
RSA.cs
來源:
RSA.cs

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

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

參數

data
Stream

輸入串流用來雜湊和簽名。

hashAlgorithm
HashAlgorithmName

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

padding
RSASignaturePadding

填充模式。

傳回

Byte[]

指定資料的 RSA 簽名。

例外狀況

data 是 null。

-或-

padding 是 null。

hashAlgorithm。Name 是 null 或 Empty。

padding 未知,或此實作不支援。

-或-

此實例僅代表公鑰。

-或-

建立簽名時發生錯誤。

另請參閱

適用於

SignData(ReadOnlySpan<Byte>, HashAlgorithmName, RSASignaturePadding)

來源:
RSA.cs
來源:
RSA.cs
來源:
RSA.cs
來源:
RSA.cs
來源:
RSA.cs

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

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

參數

data
ReadOnlySpan<Byte>

輸入資料要雜湊和簽名。

hashAlgorithm
HashAlgorithmName

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

padding
RSASignaturePadding

填充模式。

傳回

Byte[]

指定資料的 RSA 簽名。

例外狀況

padding 或 hashAlgorithm是 Namenull。

hashAlgorithm是 Name 空字串。

padding 未知,或此實作不支援。

-或-

此實例僅代表公鑰。

-或-

建立簽名時發生錯誤。

適用於

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

來源:
RSA.cs
來源:
RSA.cs
來源:
RSA.cs
來源:
RSA.cs
來源:
RSA.cs

利用指定演算法計算所提供資料的雜湊值,並以當前金鑰簽署雜湊值,將簽章寫入提供的緩衝區。

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

參數

data
ReadOnlySpan<Byte>

輸入資料要雜湊和簽名。

destination
Span<Byte>

接收 RSA 簽名的緩衝區。

hashAlgorithm
HashAlgorithmName

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

padding
RSASignaturePadding

填充模式。

傳回

寫入 destination的總位元組數。

例外狀況

padding 或 hashAlgorithm是 Namenull。

hashAlgorithm是 Name 空字串。

-或-

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

padding 未知,或此實作不支援。

-或-

此實例僅代表公鑰。

-或-

建立簽名時發生錯誤。

適用於

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

來源:
RSA.cs
來源:
RSA.cs
來源:
RSA.cs
來源:
RSA.cs
來源:
RSA.cs

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

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

參數

data
Byte[]

輸入資料要雜湊和簽名。

offset
Int32

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

count
Int32

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

hashAlgorithm
HashAlgorithmName

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

padding
RSASignaturePadding

填充模式。

傳回

Byte[]

指定資料的 RSA 簽名。

例外狀況

data 是 null。

-或-

padding 是 null。

hashAlgorithm。Name 是 null 或 Empty。

offset 小於零。

-或-

count 小於零。

-或-

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

padding 未知,或此實作不支援。

-或-

此實例僅代表公鑰。

-或-

建立簽名時發生錯誤。

另請參閱

適用於