CngKey.Open Method (String)

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

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: