แก้ไข

แชร์ผ่าน


ECDiffieHellman.DeriveKeyTls(ECDiffieHellmanPublicKey, Byte[], Byte[]) Method

Definition

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()

Parameters

otherPartyPublicKey
ECDiffieHellmanPublicKey

The other party's public key.

prfLabel
Byte[]

The ASCII-encoded PRF label.

prfSeed
Byte[]

The 64-byte PRF seed.

Returns

Byte[]

The first 48 bytes from the TLS 1.1 PRF, using the shared secret as the key.

Exceptions

A derived class must override this method.

The curve used by otherPartyPublicKey has a different size than the curve from this key.

otherPartyPublicKey, prfLabel or prfSeed is null.

prfSeed is not exactly 64 bytes in length.

-or-

The curve used by otherPartyPublicKey is different than the curve from this key.

-or-

This instance represents only a public key.

Remarks

This method internally performs the Elliptic Curve Diffie-Hellman key agreement to produce the shared secret (z).

The return value of this method is a 48 byte output of the TLS 1.1 PRF (Pseudo-Random Function), PRF(z, prfLabel, prfSeed).

For more information, see IETF RFC 4346, section 5.

Applies to