ECDiffieHellman.DeriveKeyFromHash 方法

定義

使用指定的雜湊演算法進行金鑰推導。

多載

名稱 Description
DeriveKeyFromHash(ECDiffieHellmanPublicKey, HashAlgorithmName)

使用指定的雜湊演算法進行金鑰推導。

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

當實作於衍生類別時,會使用指定的雜湊演算法進行金鑰推導,並可選擇前置或附加資料。

DeriveKeyFromHash(ECDiffieHellmanPublicKey, HashAlgorithmName)

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

使用指定的雜湊演算法進行金鑰推導。

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

參數

otherPartyPublicKey
ECDiffieHellmanPublicKey

對方的公開金鑰。

hashAlgorithm
HashAlgorithmName

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

傳回

Byte[]

共享秘密的雜訊。

例外狀況

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

-或-

hashAlgorithm 參數並未指定雜湊值。

otherPartyPublicKeynull

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

-或-

此實例僅代表公鑰。

備註

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

適用於

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

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

當實作於衍生類別時,會使用指定的雜湊演算法進行金鑰推導,並可選擇前置或附加資料。

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

-或-

此實例僅代表公鑰。

備註

此方法內部執行橢圓曲線 Diffie-Hellman 密鑰一致,產生共享祕密(z)。 此方法的回傳值是使用指定雜湊演算法的 HASH(secretPrepend || z || secretAppend) 結果,其中 || 表示串接。

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

適用於