共用方式為


ECDiffieHellman.DeriveKeyMaterial(ECDiffieHellmanPublicKey) 方法

定義

在衍生類別中實作時,依據共用密碼來執行金鑰衍生。

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

參數

otherPartyPublicKey
ECDiffieHellmanPublicKey

另一方的公開金鑰。

傳回

Byte[]

使用共用密碼作為輸入的金鑰衍生函式結果。

例外狀況

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

otherPartyPublicKeynull

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

-或-

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

備註

這個方法的預設行為相當於呼叫 DeriveKeyFromHash 將SHA-256指定為哈希演算法,且前面沒有加上或附加值。 某些實作允許變更這個方法的行為,而且建議呼叫端呼叫哪一個方法明確地指出它會執行所需的密鑰衍生。

適用於