語言

RSA.SignHash 方法

定義

利用指定的填充計算指定雜湊值的簽章。

多載

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

當在派生類別中覆寫時,會利用指定的填充計算指定雜湊值的簽章。

SignHash(ReadOnlySpan<Byte>, HashAlgorithmName, RSASignaturePadding)

利用指定的填充計算指定雜湊值的簽章。

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

用目前的金鑰簽署雜湊值,並將簽章寫入提供的緩衝區。

SignHash(Byte[], HashAlgorithmName, RSASignaturePadding)

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

當在派生類別中覆寫時,會利用指定的填充計算指定雜湊值的簽章。

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

參數

hash
Byte[]

要簽名的資料的雜湊值。

hashAlgorithm
HashAlgorithmName

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

padding
RSASignaturePadding

填充物。

傳回

Byte[]

指定雜湊值的 RSA 簽名。

例外狀況

必須有一個衍生類別覆寫此方法。

hash 或 padding 為 null。

hashAlgorithm。Name 是 null 或 Empty。

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

-或-

此實例僅代表公鑰。

-或-

建立簽名時發生錯誤。

另請參閱

適用於

SignHash(ReadOnlySpan<Byte>, HashAlgorithmName, RSASignaturePadding)

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

利用指定的填充計算指定雜湊值的簽章。

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

參數

hash
ReadOnlySpan<Byte>

要簽名的資料的雜湊值。

hashAlgorithm
HashAlgorithmName

用於產生雜 hash湊值的雜湊演算法。

padding
RSASignaturePadding

填充模式。

傳回

Byte[]

指定雜湊值的 RSA 簽名。

例外狀況

padding 或 hashAlgorithm是 Namenull。

hashAlgorithm是 Name 空字串。

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

-或-

此實例僅代表公鑰。

-或-

建立簽名時發生錯誤。

適用於

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

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

用目前的金鑰簽署雜湊值,並將簽章寫入提供的緩衝區。

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

參數

hash
ReadOnlySpan<Byte>

要簽名的資料的雜湊值。

destination
Span<Byte>

接收 RSA 簽名的緩衝區。

hashAlgorithm
HashAlgorithmName

用於產生雜 hash湊值的雜湊演算法。

padding
RSASignaturePadding

填充模式。

傳回

寫入 destination的總位元組數。

例外狀況

padding 或 hashAlgorithm是 Namenull。

hashAlgorithm是 Name 空字串。

-或-

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

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

-或-

此實例僅代表公鑰。

-或-

建立簽名時發生錯誤。

適用於