ECDiffieHellmanCng.DeriveKeyMaterial 方法

定義

衍生金鑰內容,該內容產生自雙方的密碼協議。

多載

DeriveKeyMaterial(CngKey)

衍生金鑰內容,該內容產生自雙方的密碼協議 (如果 CngKey 物件包含另一方的公開金鑰)。

DeriveKeyMaterial(ECDiffieHellmanPublicKey)

衍生金鑰內容,該內容產生自雙方的密碼協議 (如果 ECDiffieHellmanPublicKey 物件包含另一方的公開金鑰)。

備註

橢圓曲線Diffie-Hellman (ECDH) 演算法接受私密金鑰和另一方的公開金鑰作為輸入,並產生秘密合約作為輸出。 金鑰衍生函式會 (KDF) 然後取得秘密合約,並產生金鑰資料作為輸出。

DeriveKeyMaterial(CngKey)

來源:
Cng.NotSupported.cs
來源:
Cng.NotSupported.cs
來源:
Cng.NotSupported.cs

衍生金鑰內容,該內容產生自雙方的密碼協議 (如果 CngKey 物件包含另一方的公開金鑰)。

public:
 cli::array <System::Byte> ^ DeriveKeyMaterial(System::Security::Cryptography::CngKey ^ otherPartyPublicKey);
public byte[] DeriveKeyMaterial (System.Security.Cryptography.CngKey otherPartyPublicKey);
[System.Security.SecurityCritical]
public byte[] DeriveKeyMaterial (System.Security.Cryptography.CngKey otherPartyPublicKey);
override this.DeriveKeyMaterial : System.Security.Cryptography.CngKey -> byte[]
[<System.Security.SecurityCritical>]
override this.DeriveKeyMaterial : System.Security.Cryptography.CngKey -> byte[]
Public Function DeriveKeyMaterial (otherPartyPublicKey As CngKey) As Byte()

參數

otherPartyPublicKey
CngKey

物件,該物件包含金鑰交換中,另一方 Elliptic Curve Diffie-Hellman (ECDH) 金鑰的公開部分。

傳回

Byte[]

包含金鑰內容的位元組陣列。 這項資訊產生自密碼協議,該協議是從目前物件的私密金鑰和指定的公開金鑰計算而得。

屬性

例外狀況

otherPartyPublicKeynull

otherPartyPublicKey 無效。 可能是其 AlgorithmGroup 屬性未指定 ECDiffieHellman,或其金鑰大小與這個執行個體的金鑰大小不相符。

這個物件的 KeyDerivationFunction 屬性會指定 Tls 金鑰衍生函數,但是 LabelSeednull

所有其他錯誤。

適用於

DeriveKeyMaterial(ECDiffieHellmanPublicKey)

衍生金鑰內容,該內容產生自雙方的密碼協議 (如果 ECDiffieHellmanPublicKey 物件包含另一方的公開金鑰)。

public:
 override cli::array <System::Byte> ^ DeriveKeyMaterial(System::Security::Cryptography::ECDiffieHellmanPublicKey ^ otherPartyPublicKey);
public override byte[] DeriveKeyMaterial (System.Security.Cryptography.ECDiffieHellmanPublicKey otherPartyPublicKey);
override this.DeriveKeyMaterial : System.Security.Cryptography.ECDiffieHellmanPublicKey -> byte[]
Public Overrides Function DeriveKeyMaterial (otherPartyPublicKey As ECDiffieHellmanPublicKey) As Byte()

參數

otherPartyPublicKey
ECDiffieHellmanPublicKey

來自金鑰交換中另一方的公開金鑰。

傳回

Byte[]

包含金鑰內容的位元組陣列。 這項資訊產生自密碼協議,該協議是從目前物件的私密金鑰和指定的公開金鑰計算而得。

例外狀況

otherPartyPublicKeynull

otherPartyPublicKey 不是 ECDiffieHellmanCngPublicKey 金鑰。

適用於