Partager via


RSACryptoServiceProvider.PersistKeyInCsp Property

Microsoft Silverlight will reach end of support after October 2021. Learn more.

Gets or sets a value indicating whether the key should be persisted in the cryptographic service provider (CSP).

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

Syntax

'Declaration
Public Property PersistKeyInCsp As Boolean
public bool PersistKeyInCsp { get; set; }

Property Value

Type: System.Boolean
true if the key should be persisted in the CSP; otherwise, false.

Remarks

Use this property to persist a key in a key container.

The PersistKeyInCsp property is automatically set to true when you specify a key container name in a CspParameters object and use it to initialize an RSACryptoServiceProvider object. You can specify a container name using the KeyContainerName field.

If you set the PersistKeyInCsp property to true without initializing the RSACryptoServiceProvider object with a CspParameters object, a random key container name prepended with "CLR" is created.

Version Information

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1

Platforms

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.