OpenFlags Enumeration

OpenFlags Enumeration


Specifies the way to open the X.509 certificate store.

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

public enum OpenFlags

Member nameDescription

Open the X.509 certificate store and include archived certificates.


Open the X.509 certificate store for the highest access allowed.


Opens only existing stores; if no store exists, the Open method will not create a new store.


Open the X.509 certificate store for reading only.


Open the X.509 certificate store for both reading and writing.

The ReadOnly, ReadWrite, and MaxAllowed flags are mutually exclusive. The OpenExistingOnly flag is the only flag that does not require the CreateStore permission to be granted.

Legacy Code Example

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

[EventSource(Name = "Litware-ProductName-ComponentName")]
public sealed class LitwareComponentNameEventSource : EventSource
    [Event(1, Task = Tasks.Request, Opcode = EventOpcode.Send)]
    public void RequestStart(Guid relatedActivityId, int reqId, string url)
        WriteEventWithRelatedActivityId(1, relatedActivityId, reqId, url);


.NET Framework
Available since 2.0
Return to top
© 2015 Microsoft