CngKey::Open Method (String^)

 

Creates an instance of an CngKey object that represents an existing named key.

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

public:
static CngKey^ Open(
	String^ keyName
)

Parameters

keyName
Type: System::String^

The name of the key.

Return Value

Type: System.Security.Cryptography::CngKey^

An existing key.

Exception Condition
ArgumentNullException

keyName is null.

PlatformNotSupportedException

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

CryptographicException

All other errors.

This overload uses the following defaults:

KeyContainerPermissionAccessEntryCollection

for permission to open a key container. Demand value: Demand. Associated enumeration: KeyContainerPermissionFlags::Open

.NET Framework
Available since 3.5
Return to top
Show: