语言

StorePermissionFlags 枚举

定义

注意

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

指定允许访问 X.509 证书存储区。

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

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
继承
StorePermissionFlags
特性

字段

名称 值 说明
NoFlags 0

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

CreateStore 1

创建新存储的功能。

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

DeleteStore 2

能够删除存储区。

此类不公开 X509Store 此功能。

EnumerateStores 4

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

此类不公开 X509Store 此功能。

OpenStore 16

打开商店的功能。

打开商店的功能不包括枚举证书(这引发了隐私问题)或添加或删除证书(这引发了安全问题)。

AddToStore 32

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

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

RemoveFromStore 64

从存储区中删除证书的功能。

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

EnumerateCertificates 128

枚举存储中的证书的功能。

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

AllFlags 247

能够执行所有证书和存储操作。

注解

Caution

代码访问安全性(CAS)已在 .NET Framework 和 .NET 的所有版本中弃用。 如果使用与 CAS 相关的 API,最新版本的 .NET 不会遵循 CAS 注释,并会生成错误。 开发人员应寻求完成安全任务的替代方法。

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

适用于