編輯

共用方式為


StorePermissionFlags Enum

Definition

Caution

Code Access Security is not supported or honored by the runtime.

Specifies the permitted access to X.509 certificate stores.

This enumeration supports a bitwise combination of its member values.

public enum class StorePermissionFlags
[System.Flags]
[System.Obsolete("Code Access Security is not supported or honored by the runtime.", DiagnosticId="SYSLIB0003", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public enum StorePermissionFlags
[System.Flags]
[System.Serializable]
public enum StorePermissionFlags
[System.Flags]
public enum StorePermissionFlags
[<System.Flags>]
[<System.Obsolete("Code Access Security is not supported or honored by the runtime.", DiagnosticId="SYSLIB0003", UrlFormat="https://aka.ms/dotnet-warnings/{0}")>]
type StorePermissionFlags = 
[<System.Flags>]
[<System.Serializable>]
type StorePermissionFlags = 
[<System.Flags>]
type StorePermissionFlags = 
Public Enum StorePermissionFlags
Inheritance
StorePermissionFlags
Attributes

Fields

Name Value Description
NoFlags 0

Permission is not given to perform any certificate or store operations.

CreateStore 1

The ability to create a new store.

New stores are created by calling the Open(OpenFlags) method.

DeleteStore 2

The ability to delete a store.

This functionality is not exposed by the X509Store class.

EnumerateStores 4

The ability to enumerate the stores on a computer.

This functionality is not exposed by the X509Store class.

OpenStore 16

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

AddToStore 32

The ability to add a certificate to a store.

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

RemoveFromStore 64

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

EnumerateCertificates 128

The ability to enumerate the certificates in a store.

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

AllFlags 247

The ability to perform all certificate and store operations.

Examples

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

Console::WriteLine( "Creating a permission with Flags = OpenStore." );
StorePermission^ sp = gcnew StorePermission( StorePermissionFlags::OpenStore );
Console.WriteLine("Creating a permission with Flags = OpenStore.");
StorePermission sp = new StorePermission(StorePermissionFlags.OpenStore);
Console.WriteLine("Creating a permission with Flags = OpenStore.")
Dim sp As New System.Security.Permissions.StorePermission(StorePermissionFlags.OpenStore)

Remarks

Caution

Code Access Security (CAS) has been deprecated across all versions of .NET Framework and .NET. Recent versions of .NET do not honor CAS annotations and produce errors if CAS-related APIs are used. Developers should seek alternative means of accomplishing security tasks.

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 individual enumeration member.

Applies to