ECDiffieHellman.DeriveKeyFromHmac 方法

定義

使用指定的 HMAC(基於雜湊的訊息認證碼)演算法執行金鑰導出。

多載

名稱 Description
DeriveKeyFromHmac(ECDiffieHellmanPublicKey, HashAlgorithmName, Byte[], Byte[], Byte[])

當在衍生類別中實作時,會使用指定的 HMAC(基於雜湊的訊息驗證碼)演算法執行金鑰推導,並可選擇前置或附加資料。

DeriveKeyFromHmac(ECDiffieHellmanPublicKey, HashAlgorithmName, Byte[])

使用指定的 HMAC(基於雜湊的訊息認證碼)演算法執行金鑰導出。

DeriveKeyFromHmac(ECDiffieHellmanPublicKey, HashAlgorithmName, Byte[], Byte[], Byte[])

來源:
ECDiffieHellman.cs
來源:
ECDiffieHellman.cs
來源:
ECDiffieHellman.cs
來源:
ECDiffieHellman.cs
來源:
ECDiffieHellman.cs

當在衍生類別中實作時,會使用指定的 HMAC(基於雜湊的訊息驗證碼)演算法執行金鑰推導,並可選擇前置或附加資料。

public:
 virtual 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 virtual byte[] DeriveKeyFromHmac(System.Security.Cryptography.ECDiffieHellmanPublicKey otherPartyPublicKey, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, byte[]? hmacKey, byte[]? secretPrepend, byte[]? secretAppend);
public virtual byte[] DeriveKeyFromHmac(System.Security.Cryptography.ECDiffieHellmanPublicKey otherPartyPublicKey, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, byte[] hmacKey, byte[] secretPrepend, byte[] secretAppend);
abstract member DeriveKeyFromHmac : System.Security.Cryptography.ECDiffieHellmanPublicKey * System.Security.Cryptography.HashAlgorithmName * byte[] * byte[] * byte[] -> byte[]
override this.DeriveKeyFromHmac : System.Security.Cryptography.ECDiffieHellmanPublicKey * System.Security.Cryptography.HashAlgorithmName * byte[] * byte[] * byte[] -> byte[]
Public Overridable 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 使用的曲線與此鍵的曲線不同。

-或-

此實例僅代表公鑰。

備註

此方法內部執行橢圓曲線 Diffie-Hellman 密鑰一致,產生共享祕密(z)。

hmacKeynull,該方法的回傳值是使用指定 HMAC 演算法的 HMAC-HASH(z, secretPrepend || z || secretAppend) 結果,其中 || 表示串接。 否則,此方法的回傳值即為 的結果 HMAC-HASH(hmacKey, secretPrepend || z || secretAppend)

若 的secretPrependsecretAppend值為 null,則視為空陣列。

適用於

DeriveKeyFromHmac(ECDiffieHellmanPublicKey, HashAlgorithmName, Byte[])

來源:
ECDiffieHellman.cs
來源:
ECDiffieHellman.cs
來源:
ECDiffieHellman.cs
來源:
ECDiffieHellman.cs
來源:
ECDiffieHellman.cs

使用指定的 HMAC(基於雜湊的訊息認證碼)演算法執行金鑰導出。

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

參數

otherPartyPublicKey
ECDiffieHellmanPublicKey

對方的公開金鑰。

hashAlgorithm
HashAlgorithmName

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

hmacKey
Byte[]

HMAC的鑰匙。

傳回

Byte[]

共享秘密的HMAC。

例外狀況

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

-或-

hashAlgorithm 參數並未指定雜湊值。

otherPartyPublicKeynull

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

-或-

此實例僅代表公鑰。

備註

此過載會呼叫方法, DeriveKeyFromHmac 傳遞 null 前置值與附加值。

適用於