StorePermissionFlags 列舉
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
警告
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
- 繼承
- 屬性
欄位
| 名稱 | 值 | Description |
|---|---|---|
| NoFlags | 0 | 不允許執行任何憑證或儲存操作。 |
| CreateStore | 1 | 能夠創建新店。 透過呼叫該 Open(OpenFlags) 方法來建立新的儲存。 |
| DeleteStore | 2 | 刪除商店的功能。 這個功能不會由 X509Store 類別外露。 |
| EnumerateStores | 4 | 能夠在電腦上列舉這些儲存庫。 這個功能不會由 X509Store 類別外露。 |
| OpenStore | 16 | 能夠開店的能力。 開設商店的能力不包含列舉憑證(這會引起隱私疑慮)或新增或移除憑證(這會帶來安全疑慮)。 |
| AddToStore | 32 | 能夠在商店中新增憑證。 出於安全考量,此能力應僅授予高度受信任的程式碼。 |
| RemoveFromStore | 64 | 能夠從商店移除證書。 此權限應僅授予高度受信任的程式碼,因為移除憑證可能導致拒絕服務。 |
| EnumerateCertificates | 128 | 能夠在商店中列舉憑證。 出於隱私考量,這項能力應僅授予完全受信任的程式碼。 |
| AllFlags | 247 | 具備執行所有憑證與儲存操作的能力。 |
備註
注意事項
.NET Framework 和 .NET 的所有版本中,代碼存取安全性(CAS)已被棄用。 最新版本的 .NET 不會接受 CAS 註釋,如果使用 CAS 相關 API,則會產生錯誤。 開發人員應尋求其他方法來完成安全任務。
許多這些存取權限可能帶來安全與隱私威脅。 在允許商店進入時應格外謹慎。 關於存取所暴露威脅類型的簡要描述,可參考個別列舉成員的摘要。