語言

ECDiffieHellmanCng.DeriveKeyFromHash 方法

定義

使用指定的雜湊演算法執行金鑰推導,並可選擇前置或附加資料。

public:
 override cli::array <System::Byte> ^ DeriveKeyFromHash(System::Security::Cryptography::ECDiffieHellmanPublicKey ^ otherPartyPublicKey, System::Security::Cryptography::HashAlgorithmName hashAlgorithm, cli::array <System::Byte> ^ secretPrepend, cli::array <System::Byte> ^ secretAppend);
public override byte[] DeriveKeyFromHash(System.Security.Cryptography.ECDiffieHellmanPublicKey otherPartyPublicKey, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, byte[]? secretPrepend, byte[]? secretAppend);
public override byte[] DeriveKeyFromHash(System.Security.Cryptography.ECDiffieHellmanPublicKey otherPartyPublicKey, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, byte[] secretPrepend, byte[] secretAppend);
override this.DeriveKeyFromHash : System.Security.Cryptography.ECDiffieHellmanPublicKey * System.Security.Cryptography.HashAlgorithmName * byte[] * byte[] -> byte[]
Public Overrides Function DeriveKeyFromHash (otherPartyPublicKey As ECDiffieHellmanPublicKey, hashAlgorithm As HashAlgorithmName, secretPrepend As Byte(), secretAppend As Byte()) As Byte()

參數

otherPartyPublicKey
ECDiffieHellmanPublicKey

對方的公開金鑰。

hashAlgorithm
HashAlgorithmName

用來推導金鑰材料的雜湊演算法。

secretPrepend
Byte[]

一個在雜湊前為衍生秘密前加上的值。

secretAppend
Byte[]

一個在雜湊前附加於衍生秘密的值。

傳回

Byte[]

根據請求,前置或附加資料後,共享秘密的雜湊值。

例外狀況

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

所 otherPartyPublicKey 使用的曲線大小與此鍵的曲線不同。

-或-

該 hashAlgorithm 參數並未指定雜湊值。

otherPartyPublicKey 是 null。

所 otherPartyPublicKey 使用的曲線與此鍵的曲線不同。

-或-

此實例僅代表公鑰。

適用於