ECDiffieHellmanCng.DeriveKeyTls Method

Definition

Performs key derivation using the TLS (Transport Layer Security) 1.1 PRF (Pseudo-Random Function).

C#
public override 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.

Applies to

Product Versions
.NET 6, 7, 8, 9, 10
.NET Framework 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5