ECDiffieHellman.DeriveKeyTls(ECDiffieHellmanPublicKey, Byte[], Byte[]) 方法

定義

當在衍生類別中實作時,使用 TLS (傳輸層安全性) 1.1 PRF (虛擬隨機函式) 來執行金鑰衍生。

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

參數

otherPartyPublicKey
ECDiffieHellmanPublicKey

另一方的公開金鑰。

prfLabel
Byte[]

ASCII 編碼的 PRF 標籤。

prfSeed
Byte[]

64 位元組的 PRF 種子。

傳回

Byte[]

來自 TLS 1.1 PRF 的前 48 個位元組,其使用共用密碼作為金鑰。

例外狀況

衍生的類別必須覆寫這個方法。

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

otherPartyPublicKeyprfLabelprfSeednull

prfSeed 的長度不是正好 64 位元組。

-或-

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

-或-

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

備註

此方法會在內部執行橢圓曲線 Diffie-Hellman 密鑰協定,以產生共用秘密 (z) 。

這個方法的傳回值是 TLS 1.1 PRF 的 48 位元組輸出, (虛擬隨機函式) PRF(z, prfLabel, prfSeed)

如需詳細資訊,請參閱 IETF RFC 4346 第 5 節

適用於