Export (0) Print
Expand All
Expand Minimize

StorePermissionFlags Enumeration

Specifies the permitted access to X.509 certificate stores.

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

Namespace:  System.Security.Permissions
Assembly:  System (in System.dll)

[SerializableAttribute]
[FlagsAttribute]
public enum StorePermissionFlags

Member nameDescription
AddToStoreThe ability to add a certificate to a store.

For security reasons, this ability should be granted only to highly trusted code.

AllFlagsThe ability to perform all certificate and store operations.
CreateStoreThe ability to create a new store.

New stores are created by calling the X509Store.Open method.

DeleteStoreThe ability to delete a store.

This functionality is not exposed by the X509Store class.

EnumerateCertificatesThe ability to enumerate the certificates in a store.

For privacy reasons, this ability should be granted only to fully trusted code.

EnumerateStoresThe ability to enumerate the stores on a computer.

This functionality is not exposed by the X509Store class.

NoFlagsPermission is not given to perform any certificate or store operations.
OpenStoreThe ability to open a store.

The ability to open a store does not include the ability to enumerate certificates (which raises privacy concerns) or to add or remove certificates (which raises security concerns).

RemoveFromStoreThe ability to remove a certificate from a store.

This ability should be granted only to highly trusted code because removing a certificate can result in a denial of service.

Many of these access permissions pose potential security and privacy threats. Great care should be taken in granting access to stores. A brief description of the type of threat exposed by an access can be found in the summary for the access.

The following code example shows the use of the StorePermissionFlags enumeration.

Console.WriteLine("Creating a permission with Flags = OpenStore.");
StorePermission sp = new StorePermission(StorePermissionFlags.OpenStore);

.NET Framework

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

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

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