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)

備註

其中許多存取權限都可能造成安全性與隱私權威脅。 在授與存放區的存取權時,應該特別小心。 您可以在個別列舉成員的摘要中找到存取權所公開威脅類型的簡短描述。

適用於