ECDiffieHellman.DeriveKeyMaterial(ECDiffieHellmanPublicKey) Method

Definition

Important

Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.

When implemented in a derived class, performs a key derivation on the shared secret.

C#
public virtual byte[] DeriveKeyMaterial(System.Security.Cryptography.ECDiffieHellmanPublicKey otherPartyPublicKey);
C#
public abstract byte[] DeriveKeyMaterial(System.Security.Cryptography.ECDiffieHellmanPublicKey otherPartyPublicKey);

Parameters

otherPartyPublicKey
ECDiffieHellmanPublicKey

The other party's public key.

Returns

Byte[]

The result of the key derivation function, using the shared secret as an input.

Exceptions

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

otherPartyPublicKey is null.

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

-or-

This instance represents only a public key.

Remarks

The default behavior of this method is equivalent to calling DeriveKeyFromHash specifying SHA-256 as the hash algorithm with no prepend or append values. Some implementations allow the behavior of this method to be changed, and callers are advised to call whichever method explicitly says it performs the key derivation they need.

Applies to

Produkt Verzie
.NET Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.1