RSA.SignHash(Byte[], HashAlgorithmName, RSASignaturePadding) 方法

定義

在衍生類別中覆寫時,針對指定雜湊值的簽章,使用指定的填補來計算。When overridden in a derived class, computes the signature for the specified hash value using the specified padding.

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[]

要簽署之資料的雜湊值。The hash value of the data to be signed.

hashAlgorithm
HashAlgorithmName

用來建立該資料雜湊值的雜湊演算法。The hash algorithm used to create the hash value of the data.

padding
RSASignaturePadding

填補。The padding.

傳回

Byte[]

指定雜湊值的 RSA 簽章。The RSA signature for the specified hash value.

例外狀況

衍生的類別必須覆寫這個方法。A derived class must override this method.

datapaddingnulldata or padding is null.

hashAlgorithm.NamehashAlgorithm.Name nullEmptyis null or Empty.

padding 未知,或不支援此實作。padding is unknown, or not supported by this implementation.

-或--or-

這個執行個體只表示公開金鑰。This instance represents only a public key.

-或--or-

建立簽章時發生錯誤。An error occurred creating the signature.

適用於

另請參閱