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 參數未指定雜湊。

otherPartyPublicKeynull

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

-或-

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

適用於