Export (0) Print
Expand All
Expand Minimize

CspProviderFlags Enumeration

Specifies flags that modify the behavior of the cryptographic service providers (CSP).

This enumeration has a FlagsAttribute attribute that allows a bitwise combination of its member values.

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

[SerializableAttribute]
[FlagsAttribute]
[ComVisibleAttribute(true)]
public enum class CspProviderFlags

Member nameDescription
CreateEphemeralKeyCreate a temporary key that is released when the associated Rivest-Shamir-Adleman (RSA) object is closed. Do not use this flag if you want your key to be independent of the RSA object.
Important noteImportant

The CreateEphemeralKey flag provides temporary keys with more reliable cleanup. If this flag is not used, the common language runtime (CLR) generates a randomly named key when an RSA object is created. When the object is finalized or disposed of, the key is deleted. When impersonation is in effect, not explicitly calling Dispose can potentially create a problem. For example, if you use impersonation, create an RSA object, and do not dispose of it, the finalizer thread (which is not impersonating) can fail to delete the key, and then throws an exception. This exception is unhandled and can terminate the process. The resources allocated to the key are not recovered, resulting in a memory leak. The KeyContainerPermission demand is suppressed by this flag.

NoFlagsDo not specify any settings.
NoPromptPrevent the CSP from displaying any user interface (UI) for this context.
UseArchivableKeyAllow a key to be exported for archival or recovery.
UseDefaultKeyContainerUse key information from the default key container.
UseExistingKeyUse key information from the current key.
UseMachineKeyStoreUse key information from the computer's key store.
UseNonExportableKeyUse key information that cannot be exported.
UseUserProtectedKeyNotify the user through a dialog box or another method when certain actions are attempting to use a key. This flag is not compatible with the NoPrompt flag.

.NET Framework

Supported in: 4.5.2, 4.5.1, 4.5, 4, 3.5, 3.0, 2.0, 1.1, 1.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

.NET for Windows Phone apps

Supported in: Windows Phone 8.1, Windows Phone 8, Silverlight 8.1

Windows Phone 8.1, Windows Phone 8, Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Show:
© 2014 Microsoft