PersistKeyInCsp Property
Collapse the table of content
Expand the table of content

RSACryptoServiceProvider.PersistKeyInCsp Property

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

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

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

public bool PersistKeyInCsp { get; set; }

Property Value

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

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.

Windows Phone OS

Supported in: 8.1, 8.0, 7.1

Windows Phone

© 2017 Microsoft