ECDiffieHellmanCngPublicKey.FromByteArray(Byte[], CngKeyBlobFormat) 方法

定義

根據指定的格式,將包含公開金鑰的位元組陣列轉換成 ECDiffieHellmanCngPublicKey 物件。

public static System.Security.Cryptography.ECDiffieHellmanPublicKey FromByteArray (byte[] publicKeyBlob, System.Security.Cryptography.CngKeyBlobFormat format);
[System.Runtime.Versioning.SupportedOSPlatform("windows")]
public static System.Security.Cryptography.ECDiffieHellmanPublicKey FromByteArray (byte[] publicKeyBlob, System.Security.Cryptography.CngKeyBlobFormat format);
[System.Security.SecurityCritical]
public static System.Security.Cryptography.ECDiffieHellmanPublicKey FromByteArray (byte[] publicKeyBlob, System.Security.Cryptography.CngKeyBlobFormat format);

參數

publicKeyBlob
Byte[]

包含 Elliptic Curve Diffie-Hellman (ECDH) 公開金鑰的位元組陣列。

format
CngKeyBlobFormat

指定金鑰 BLOB 格式的物件。

傳回

包含在位元組陣列中序列化的 ECDH 公開金鑰的物件。

屬性

例外狀況

publicKeyBlobformat 參數為 null

publicKeyBlob 參數未包含 ECDiffieHellman 金鑰。

備註

此靜態方法會在所有 ECDiffieHellmanCngPublicKey 實例之間共用。

適用於

產品 版本
.NET 6, 7, 8, 9
.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 (package-provided), 4.7.1, 4.7.2 (package-provided), 4.7.2, 4.8 (package-provided), 4.8, 4.8.1
.NET Standard 2.1 (package-provided)
Windows Desktop 3.0, 3.1, 5