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

開啟金鑰容器並使用公開金鑰 (Public Key)。

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 會使用此列舉。

警告

其中許多旗標可能會有強大的效果,而且應該只授與高度信任的程式碼。

功能最強大的旗標為 CreateDeleteImportExport Sign 、、 DecryptAllFlags 。 如需使用這些旗標可以呈現的特定威脅,請參閱成員描述。

適用於