StorePermissionFlags 枚举

定义

注意

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

指定对 X.509 证书存储区的允许访问权限。

此枚举支持其成员值的按位组合。

public enum class 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}")]
public enum StorePermissionFlags
[System.Flags]
[System.Serializable]
public enum StorePermissionFlags
[<System.Flags>]
type 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 = 
Public Enum StorePermissionFlags
继承
StorePermissionFlags
属性

字段

AddToStore 32

将证书添加到存储区的能力。

出于安全原因,应仅向高度受信任的代码授予此功能。

AllFlags 247

执行所有证书和存储区操作的能力。

CreateStore 1

新建存储区的能力。

新存储是通过调用 Open(OpenFlags) 方法创建而成的。

DeleteStore 2

删除存储区的能力。

X509Store 类没有公开此功能。

EnumerateCertificates 128

枚举存储区中的证书的能力。

出于隐私原因,应仅向高度受信任的代码授予此功能。

EnumerateStores 4

枚举计算机上的存储区的能力。

X509Store 类没有公开此功能。

NoFlags 0

未授予执行任何证书或存储区操作的权限。

OpenStore 16

打开存储区的能力。

打开存储的功能不包括枚举证书(导致隐私问题)以及添加或删除证书(导致安全问题)的功能。

RemoveFromStore 64

从存储区中移除证书的能力。

此功能应仅授予给高度受信任的代码,因为删除证书可能会导致拒绝服务。

示例

下面的代码示例演示枚举的使用 StorePermissionFlags

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)

注解

其中许多访问权限构成了潜在的安全和隐私威胁。 应非常小心地授予对商店的访问权限。 可以在单个枚举成员的摘要中找到访问公开的威胁类型的简短说明。

适用于