Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

CngKey::Exists Method (String^, CngProvider^)

 

Checks to see whether a named key exists in the specified key storage provider (KSP).

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

public:
static bool Exists(
	String^ keyName,
	CngProvider^ provider
)

Parameters

keyName
Type: System::String^

The key name.

provider
Type: System.Security.Cryptography::CngProvider^

The KSP to check for the key.

Return Value

Type: System::Boolean

true if the named key exists in the specified provider; otherwise, false.

Exception Condition
ArgumentNullException

keyName or provider is null.

PlatformNotSupportedException

Cryptography Next Generation (CNG) is not supported on this system.

CryptographicException

All other errors.

Use this overload to check for the existence of a key in a KSP other than the default KSP, which is MicrosoftSoftwareKeyStorageProvider.

.NET Framework
Available since 3.5
Return to top
Show:
© 2017 Microsoft