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

定義

當在衍生類別中實作時,使用 TLS (傳輸層安全性) 1.1 PRF (虛擬隨機函式) 來執行金鑰衍生。When implemented in a derived class, performs key derivation using the TLS (Transport Layer Security) 1.1 PRF (Pseudo-Random Function).

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

另一方的公開金鑰。The other party's public key.

prfLabel
Byte[]

ASCII 編碼的 PRF 標籤。The ASCII-encoded PRF label.

prfSeed
Byte[]

64 位元組的 PRF 種子。The 64-byte PRF seed.

傳回

Byte[]

來自 TLS 1.1 PRF 的前 48 個位元組,其使用共用密碼作為金鑰。The first 48 bytes from the TLS 1.1 PRF, using the shared secret as the key.

例外狀況

衍生的類別必須覆寫這個方法。A derived class must override this method.

otherPartyPublicKey 所使用曲線與此金鑰的曲線大小不同。The curve used by otherPartyPublicKey has a different size than the curve from this key.

otherPartyPublicKeyprfLabelprfSeednullotherPartyPublicKey, prfLabel or prfSeed is null.

prfSeed 的長度不是正好 64 位元組。prfSeed is not exactly 64 bytes in length.

-或--or-

otherPartyPublicKey 所使用曲線與此金鑰的曲線不同。The curve used by otherPartyPublicKey is different than the curve from this key.

-或--or-

這個執行個體只表示公開金鑰。This instance represents only a public key.

備註

這個方法會在內部執行橢圓曲線 Diffie-hellman 金鑰協定,以產生共用密碼 (z) 。This method internally performs the Elliptic Curve Diffie-Hellman key agreement to produce the shared secret (z).

此方法的傳回值是 TLS 1.1 PRF 的48位元組輸出 (虛擬隨機函式) , PRF(z, prfLabel, prfSeed)The return value of this method is a 48 byte output of the TLS 1.1 PRF (Pseudo-Random Function), PRF(z, prfLabel, prfSeed).

如需詳細資訊,請參閱 IETF RFC 4346,第5節For more information, see IETF RFC 4346, section 5.

適用於