CngKey.Delete Method ()

 
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.

Removes the key that is associated with the object.

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

public void Delete()

Exception Condition
ObjectDisposedException

An attempt was made to access a deleted key.

CryptographicException

All other errors.

  • When you call the Delete method on an ephemeral key, it closes the handle to the key.

When you call the Delete method on a named key, the CngKey object can no longer be used after the named key is deleted.

KeyContainerPermission

for permission to sign data. Demand value: Demand. Associated enumeration: KeyContainerPermissionFlags.Delete

.NET Framework
Available since 3.5
Return to top
Show: