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::IsEphemeral Property

 

Gets the persistence state of the key.

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

public:
property bool IsEphemeral {
	bool get();
	[SecurityCriticalAttribute]
	private: void set(bool value);
}

Property Value

Type: System::Boolean

true if the key is ephemeral; otherwise, false.

This property determines whether the key is ephemeral (that is, the key exists only for the lifetime of the handle), or persisted (that is, the key exists independently of the handle).

The return value depends on the method that is used to obtain the key:

  • If the key was not opened by the Open(SafeNCryptKeyHandle^, CngKeyHandleOpenOptions) method overload, the common language runtime (CLR) is managing the key and can determine whether it is ephemeral.

  • If the key was opened by the Open(SafeNCryptKeyHandle^, CngKeyHandleOpenOptions) method overload, the CLR cannot determine whether it is ephemeral. Therefore, the key is assumed to be persisted. However, if this method is used to open a handle to a key that is created by the CLR, the CLR will be able to determine whether it is ephemeral.

This property does not have a public setter; it is read-only.

.NET Framework
Available since 3.5
Return to top
Show:
© 2017 Microsoft