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

C#
public virtual byte[] DeriveKeyTls(System.Security.Cryptography.ECDiffieHellmanPublicKey otherPartyPublicKey, byte[] prfLabel, byte[] prfSeed);

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

Product Versions
.NET Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.1