KeyContainerPermissionFlags 枚举

定义

注意

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

指定允许的密钥容器访问类型。

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

public enum class KeyContainerPermissionFlags
public enum KeyContainerPermissionFlags
[System.Obsolete("Code Access Security is not supported or honored by the runtime.", DiagnosticId="SYSLIB0003", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public enum KeyContainerPermissionFlags
[System.Flags]
[System.Runtime.InteropServices.ComVisible(true)]
[System.Serializable]
public enum KeyContainerPermissionFlags
type KeyContainerPermissionFlags = 
[<System.Obsolete("Code Access Security is not supported or honored by the runtime.", DiagnosticId="SYSLIB0003", UrlFormat="https://aka.ms/dotnet-warnings/{0}")>]
type KeyContainerPermissionFlags = 
[<System.Flags>]
[<System.Runtime.InteropServices.ComVisible(true)>]
[<System.Serializable>]
type KeyContainerPermissionFlags = 
Public Enum KeyContainerPermissionFlags
继承
KeyContainerPermissionFlags
属性

字段

AllFlags 13111

创建、解密、删除、打开密钥容器;导出、导入密钥;使用密钥给文件签名;查看并更改密钥容器的访问控制列表。

ChangeAcl 8192

更改密钥容器的访问控制列表 (ACL)。

Create 1

创建密钥容器。

创建密钥容器时还会在磁盘上创建一个文件。 请务必注意,创建的任何密钥容器都将在不再使用时删除,这一点非常重要。

Decrypt 512

解密密钥容器。

解密是一项特权操作,因为需要使用私钥。

Delete 4

删除密钥容器。

删除密钥容器可能导致拒绝服务攻击,因为删除密钥容器会阻止使用经密钥加密或签名的文件。 因此,删除是一项特权操作。

Export 32

从密钥容器导出密钥。

导出密钥的功能可能是有害的,因为它会破坏该密钥的唯一性。

Import 16

将密钥导入密钥容器。

类似于删除容器的功能,导入密钥的功能同样可能有害,因为向已命名的密钥容器导入密钥会替换已有的密钥。

NoFlags 0

不能访问密钥容器。

Open 2

打开一个密钥容器并使用公钥。

Open 不授予使用私钥对文件进行签名或解密的权限,但允许用户验证文件签名和加密文件。 只有密钥所有者可以使用私钥对这些文件进行解密。

Sign 256

使用密钥给文件签名。

对文件进行签名的功能可能是有害的,因为该功能可以让用户使用其他用户的密钥对文件进行签名。

ViewAcl 4096

查看密钥容器的访问控制列表 (ACL)。

示例

以下示例演示枚举的使用 KeyContainerPermissionFlags

// Create a KeyContainerPermission with the right to open the key container.
KeyContainerPermission ^ keyContainerPerm = gcnew KeyContainerPermission( KeyContainerPermissionFlags::Open );
// Create a KeyContainerPermission with the right 
// to open the key container.
KeyContainerPermission keyContainerPerm = new
     KeyContainerPermission(KeyContainerPermissionFlags.Open);
' Create a KeyContainerPermission with the right to open the key container.
Dim keyContainerPerm As New KeyContainerPermission(KeyContainerPermissionFlags.Open)

注解

此枚举由类的成员 KeyContainerPermissionAccessEntry 使用。

注意

其中许多标志可能具有强大的效果,应只授予高度受信任的代码。

最强大的旗帜是CreateDeleteImportExportSign、和Decrypt``AllFlags。 有关使用这些标志的特定威胁,请参阅成员说明。

适用于