Lire en anglais

Partager via


CngKey.Import Méthode

Définition

Crée une clé en important le matériel clé dans le fournisseur de stockage de clés (KSP).

Surcharges

Import(Byte[], CngKeyBlobFormat, CngProvider)

Crée une clé en important le matériel clé indiqué dans le fournisseur de stockage de clés (KSP) spécifié, à l’aide du format spécifié.

Import(Byte[], CngKeyBlobFormat)

Crée une clé en important le matériel clé spécifié dans le fournisseur de stockage de clés par défaut (KSP) et en utilisant le format spécifié.

Import(Byte[], CngKeyBlobFormat, CngProvider)

Source:
Cng.NotSupported.cs
Source:
Cng.NotSupported.cs
Source:
Cng.NotSupported.cs

Crée une clé en important le matériel clé indiqué dans le fournisseur de stockage de clés (KSP) spécifié, à l’aide du format spécifié.

C#
public static System.Security.Cryptography.CngKey Import (byte[] keyBlob, System.Security.Cryptography.CngKeyBlobFormat format, System.Security.Cryptography.CngProvider provider);
C#
[System.Runtime.Versioning.SupportedOSPlatform("windows")]
public static System.Security.Cryptography.CngKey Import (byte[] keyBlob, System.Security.Cryptography.CngKeyBlobFormat format, System.Security.Cryptography.CngProvider provider);
C#
[System.Security.SecurityCritical]
public static System.Security.Cryptography.CngKey Import (byte[] keyBlob, System.Security.Cryptography.CngKeyBlobFormat format, System.Security.Cryptography.CngProvider provider);

Paramètres

keyBlob
Byte[]

Tableau qui contient les informations de clé.

format
CngKeyBlobFormat

Objet qui spécifie le format du tableau de keyBlob.

provider
CngProvider

KSP.

Retours

Nouvelle clé.

Attributs

Exceptions

keyBlob, format ou provider est null.

CNG (Cryptography Next Generation) n’est pas pris en charge sur ce système.

Toutes les autres erreurs.

Remarques

Important

Sur les systèmes d’exploitation Windows antérieurs à Windows 7 et Windows Server 2008 R2, certains formats BLOB (Key CNG Binary Large Object) ne sont pas pris en charge.

S’applique à

.NET 9 et autres versions
Produit Versions
.NET Core 1.0, Core 1.1, 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, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1
Windows Desktop 3.0, 3.1, 5

Import(Byte[], CngKeyBlobFormat)

Source:
Cng.NotSupported.cs
Source:
Cng.NotSupported.cs
Source:
Cng.NotSupported.cs

Crée une clé en important le matériel clé spécifié dans le fournisseur de stockage de clés par défaut (KSP) et en utilisant le format spécifié.

C#
public static System.Security.Cryptography.CngKey Import (byte[] keyBlob, System.Security.Cryptography.CngKeyBlobFormat format);
C#
[System.Runtime.Versioning.SupportedOSPlatform("windows")]
public static System.Security.Cryptography.CngKey Import (byte[] keyBlob, System.Security.Cryptography.CngKeyBlobFormat format);

Paramètres

keyBlob
Byte[]

Tableau qui contient les informations de clé.

format
CngKeyBlobFormat

Objet qui spécifie le format du tableau de keyBlob.

Retours

Nouvelle clé.

Attributs

Exceptions

keyBlob ou format est null.

CNG (Cryptography Next Generation) n’est pas pris en charge sur ce système.

Toutes les autres erreurs.

Remarques

Le KSP par défaut est MicrosoftSoftwareKeyStorageProvider.

Important

Sur les systèmes d’exploitation Windows antérieurs à Windows 7 et Windows Server 2008 R2, certains formats BLOB (Key CNG Binary Large Object) ne sont pas pris en charge.

S’applique à

.NET 9 et autres versions
Produit Versions
.NET Core 1.0, Core 1.1, 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, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1
Windows Desktop 3.0, 3.1, 5