ECDiffieHellmanCngPublicKey.FromByteArray Method (Byte[], CngKeyBlobFormat)

 

Converts a byte array that contains a public key to a ECDiffieHellmanCngPublicKey object according to the specified format.

Namespace:   System.Security.Cryptography
Assembly:  System.Core (in System.Core.dll)

public static ECDiffieHellmanPublicKey FromByteArray(
	byte[] publicKeyBlob,
	CngKeyBlobFormat format
)

Parameters

publicKeyBlob
Type: System.Byte[]

A byte array that contains an Elliptic Curve Diffie-Hellman (ECDH) public key.

format
Type: System.Security.Cryptography.CngKeyBlobFormat

An object that specifies the format of the key BLOB.

Return Value

Type: System.Security.Cryptography.ECDiffieHellmanPublicKey

An object that contains the ECDH public key that is serialized in the byte array.

Exception Condition
ArgumentNullException

The publicKeyBlob or format parameter is null.

ArgumentException

The publicKeyBlob parameter does not contain an ECDiffieHellman key.

This static method is shared among all ECDiffieHellmanCngPublicKey instances.

.NET Framework
Available since 3.5
Return to top
Show: