CngKey.Exists Method (String)

 

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

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

public static bool Exists(
	string keyName
)

Parameters

keyName
Type: System.String

The key name.

Return Value

Type: System.Boolean

true if the named key exists in the default KSP; otherwise, false.

Exception Condition
ArgumentNullException

keyName is null.

PlatformNotSupportedException

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

CryptographicException

All other errors.

.NET Framework
Available since 3.5
Return to top
Show: