語言

CngKey.Exists 方法

定義

檢查特定金鑰儲存提供者(KSP)中是否有指定金鑰。

多載

名稱 Description
Exists(String)

檢查預設金鑰儲存提供者(KSP)中是否存在指定金鑰。

Exists(String, CngProvider)

檢查指定的金鑰儲存提供者(KSP)中是否存在命名金鑰。

Exists(String, CngProvider, CngKeyOpenOptions)

根據指定的選項檢查指定金鑰儲存提供者(KSP)中是否存在命名金鑰。

Exists(String)

來源:
Cng.NotSupported.cs
來源:
Cng.NotSupported.cs
來源:
Cng.NotSupported.cs
來源:
Cng.NotSupported.cs
來源:
Cng.NotSupported.cs

檢查預設金鑰儲存提供者(KSP)中是否存在指定金鑰。

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

參數

keyName
String

金鑰名稱。

傳回

true如果指定金鑰存在於預設的 KSP 中;否則,。 false

屬性

例外狀況

keyName 是 null。

此系統不支援密碼學下一代(CNG)。

其他所有錯誤。

備註

預設的 KSP 為 MicrosoftSoftwareKeyStorageProvider。

適用於

Exists(String, CngProvider)

來源:
Cng.NotSupported.cs
來源:
Cng.NotSupported.cs
來源:
Cng.NotSupported.cs
來源:
Cng.NotSupported.cs
來源:
Cng.NotSupported.cs

檢查指定的金鑰儲存提供者(KSP)中是否存在命名金鑰。

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

參數

keyName
String

金鑰名稱。

provider
CngProvider

KSP 會檢查鑰匙。

傳回

true如果指定金鑰存在於指定的提供者中;否則,。 false

屬性

例外狀況

keyName 或 provider 為 null。

此系統不支援密碼學下一代(CNG)。

其他所有錯誤。

備註

利用此超載來檢查 KSP 中是否存在除預設 KSP MicrosoftSoftwareKeyStorageProvider以外的金鑰。

適用於

Exists(String, CngProvider, CngKeyOpenOptions)

來源:
Cng.NotSupported.cs
來源:
Cng.NotSupported.cs
來源:
Cng.NotSupported.cs
來源:
Cng.NotSupported.cs
來源:
Cng.NotSupported.cs

根據指定的選項檢查指定金鑰儲存提供者(KSP)中是否存在命名金鑰。

public:
 static bool Exists(System::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);
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);
[<System.Runtime.Versioning.SupportedOSPlatform("windows")>]
static member Exists : string * System.Security.Cryptography.CngProvider * System.Security.Cryptography.CngKeyOpenOptions -> bool
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

參數

keyName
String

金鑰名稱。

provider
CngProvider

KSP 用來尋找鑰匙。

options
CngKeyOpenOptions

一個位元組合的列舉值,用來指定開啟鍵的選項。

傳回

true如果指定金鑰存在於指定的提供者中;否則,。 false

屬性

例外狀況

keyName 或 provider 為 null。

此系統不支援密碼學下一代(CNG)。

其他所有錯誤。

備註

利用此超載檢查 KSP 中是否存在非預設 MicrosoftSoftwareKeyStorageProvider的金鑰,並指定金鑰開啟選項。

適用於