RSA.SignHash 方法

定義

多載

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

在衍生類別中覆寫時,針對指定雜湊值的簽章,使用指定的填補來計算。

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

例外狀況

衍生的類別必須覆寫這個方法。

datapaddingnull

hashAlgorithm.NamenullEmpty

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

-或-

這個執行個體只表示公開金鑰。

-或-

建立簽章時發生錯誤。

另請參閱

適用於

SignHash(ReadOnlySpan<Byte>, HashAlgorithmName, RSASignaturePadding)

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

例外狀況

paddinghashAlgorithmNamenull

hashAlgorithmName是空字串。

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

-或-

這個執行個體只表示公開金鑰。

-或-

建立簽章時發生錯誤。

適用於

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

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

例外狀況

paddinghashAlgorithmNamenull

hashAlgorithmName是空字串。

-或-

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

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

-或-

這個執行個體只表示公開金鑰。

-或-

建立簽章時發生錯誤。

適用於