X509Store.Open Method (OpenFlags)


Opens an X.509 certificate store or creates a new store, depending on OpenFlags flag settings.

Namespace:   System.Security.Cryptography.X509Certificates
Assembly:  System (in System.dll)

member Open : 
        flags:OpenFlags -> unit


Type: System.Security.Cryptography.X509Certificates.OpenFlags

A bitwise combination of enumeration values that specifies the way to open the X.509 certificate store.

Exception Condition

The store is unreadable.


The caller does not have the required permission.


The store contains invalid values.

Use this method to open an existing X.509 store. Note that you must have additional permissions, specified by StorePermissionFlags, to enumerate the certificates in the store. You can create a new store by passing a store name that does not exist to the class constructor, and then using any of the OpenFlags flags except OpenExistingOnly.

The following code example opens an X.509 certificate store, adds and deletes certificates, and then closes the store. It assumes that you have three certificates to add to and remove from a local store.

No code example is currently available or this language may not be supported.


for opening an X.509 certificate store. Security action: Demand. Associated enumerations: StorePermissionFlags.OpenStore, StorePermissionFlags.CreateStore

.NET Framework
Available since 2.0
Return to top