ECDiffieHellmanOpenSsl.DeriveKeyFromHmac 方法

定義

使用指定的 HMAC (雜湊式訊息驗證碼) 演算法搭配選擇性的前置或附加資料來執行金鑰衍生。

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

參數

otherPartyPublicKey
ECDiffieHellmanPublicKey

另一方的公開金鑰。

hashAlgorithm
HashAlgorithmName

要用來衍生金鑰內容的雜湊演算法。

hmacKey
Byte[]

HMAC 的金鑰。

secretPrepend
Byte[]

雜湊之前要加在衍生密碼前面的值。

secretAppend
Byte[]

雜湊之前要附加至衍生密碼的值。

傳回

Byte[]

依要求前置或附加資料後的共用密碼 HMAC。

例外狀況

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

-或-

hashAlgorithm 參數未指定雜湊。

otherPartyPublicKeynull

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

-或-

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

適用於