CngKey.Exists Méthode

Définition

Vérifie s'il existe une clé nommée dans un fournisseur de stockage de clés (KSP) spécifique.

Surcharges

Exists(String)

Vérifie s'il existe une clé nommée dans le fournisseur de stockage de clés (KSP) par défaut.

Exists(String, CngProvider)

Vérifie s'il existe une clé nommée dans le fournisseur de stockage de clés (KSP) spécifié.

Exists(String, CngProvider, CngKeyOpenOptions)

Vérifie si une clé nommée existe dans le fournisseur de stockage de clés (KSP) spécifié, conformément aux options spécifiées.

Exists(String)

Vérifie s'il existe une clé nommée dans le fournisseur de stockage de clés (KSP) par défaut.

public:
 static bool Exists(System::String ^ keyName);
public static bool Exists (string keyName);
[System.Runtime.Versioning.SupportedOSPlatform("windows")]
public static bool Exists (string keyName);
static member Exists : string -> bool
[<System.Runtime.Versioning.SupportedOSPlatform("windows")>]
static member Exists : string -> bool
Public Shared Function Exists (keyName As String) As Boolean

Paramètres

keyName
String

Nom de la clé.

Retours

true si la clé nommée existe dans le KSP par défaut ; sinon, false.

Attributs

Exceptions

keyName a la valeur 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.

S’applique à

Exists(String, CngProvider)

Vérifie s'il existe une clé nommée dans le fournisseur de stockage de clés (KSP) spécifié.

public:
 static bool Exists(System::String ^ keyName, System::Security::Cryptography::CngProvider ^ provider);
public static bool Exists (string keyName, System.Security.Cryptography.CngProvider provider);
[System.Runtime.Versioning.SupportedOSPlatform("windows")]
public static bool Exists (string keyName, System.Security.Cryptography.CngProvider provider);
static member Exists : string * System.Security.Cryptography.CngProvider -> bool
[<System.Runtime.Versioning.SupportedOSPlatform("windows")>]
static member Exists : string * System.Security.Cryptography.CngProvider -> bool
Public Shared Function Exists (keyName As String, provider As CngProvider) As Boolean

Paramètres

keyName
String

Nom de la clé.

provider
CngProvider

Le KSP à vérifier pour la clé.

Retours

true si la clé nommée existe dans le fournisseur spécifié ; sinon, false.

Attributs

Exceptions

keyName ou provider est null.

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

Toutes les autres erreurs.

Remarques

Utilisez cette surcharge pour case activée pour l’existence d’une clé dans un KSP autre que le KSP par défaut, qui est MicrosoftSoftwareKeyStorageProvider.

S’applique à

Exists(String, CngProvider, CngKeyOpenOptions)

Vérifie si une clé nommée existe dans le fournisseur de stockage de clés (KSP) spécifié, conformément aux options spécifiées.

public:
 static bool Exists(System::String ^ keyName, System::Security::Cryptography::CngProvider ^ provider, System::Security::Cryptography::CngKeyOpenOptions options);
public static bool Exists (string keyName, System.Security.Cryptography.CngProvider provider, System.Security.Cryptography.CngKeyOpenOptions options);
[System.Runtime.Versioning.SupportedOSPlatform("windows")]
public static bool Exists (string keyName, System.Security.Cryptography.CngProvider provider, System.Security.Cryptography.CngKeyOpenOptions options);
[System.Security.SecurityCritical]
public static bool Exists (string keyName, System.Security.Cryptography.CngProvider provider, System.Security.Cryptography.CngKeyOpenOptions options);
static member Exists : string * System.Security.Cryptography.CngProvider * System.Security.Cryptography.CngKeyOpenOptions -> bool
[<System.Runtime.Versioning.SupportedOSPlatform("windows")>]
static member Exists : string * System.Security.Cryptography.CngProvider * System.Security.Cryptography.CngKeyOpenOptions -> bool
[<System.Security.SecurityCritical>]
static member Exists : string * System.Security.Cryptography.CngProvider * System.Security.Cryptography.CngKeyOpenOptions -> bool
Public Shared Function Exists (keyName As String, provider As CngProvider, options As CngKeyOpenOptions) As Boolean

Paramètres

keyName
String

Nom de la clé.

provider
CngProvider

KSP dans lequel rechercher la clé.

options
CngKeyOpenOptions

Combinaison d'opérations de bits des valeurs d'énumération qui spécifient les options d'ouverture d'une clé.

Retours

true si la clé nommée existe dans le fournisseur spécifié ; sinon, false.

Attributs

Exceptions

keyName ou provider est null.

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

Toutes les autres erreurs.

Remarques

Utilisez cette surcharge pour case activée pour l’existence d’une clé dans un KSP autre que la valeur par défaut MicrosoftSoftwareKeyStorageProvideret pour spécifier les options d’ouverture de clé.

S’applique à