Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
StorePermissionFlags Enumeration
Collapse the table of content
Expand the table of content

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
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.6, 4.5, 4, 3.5, 3.0, 2.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
© 2015 Microsoft