This documentation is archived and is not being maintained.

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)

public enum StorePermissionFlags

Member nameDescription
NoFlagsPermission is not given to perform any certificate or 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.

EnumerateStoresThe ability to enumerate the stores on a computer.

This functionality is not exposed by the X509Store class.

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).

AddToStoreThe ability to add a certificate to a store.

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

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.

EnumerateCertificatesThe ability to enumerate the certificates in a store.

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

AllFlagsThe ability to perform all certificate and store operations.

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, 3.5, 3.0, 2.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

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