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::Delete Method ()

 

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:
© 2017 Microsoft