2 // MemoryCertificateStore.cs: Handles an in-memory certificate store.
\r
5 // Sebastien Pouliot (spouliot@motus.com)
\r
7 // (C) 2003 Motus Technologies Inc. (http://www.motus.com)
\r
12 namespace Microsoft.Web.Services.Security.X509 {
\r
14 internal class MemoryCertificateStore : ICertificateStore {
\r
16 private string _storeName;
\r
17 private X509CertificateStore.StoreOpenFlags _flags;
\r
18 private X509CertificateStore.StoreLocation _location;
\r
19 private IntPtr _handle;
\r
20 private X509CertificateCollection _coll;
\r
22 public MemoryCertificateStore (X509CertificateStore.StoreLocation location, string storeName, X509CertificateStore.StoreOpenFlags flags)
\r
24 _location = location;
\r
25 _storeName = storeName;
\r
27 _coll = new X509CertificateCollection ();
\r
30 public void Close ()
\r
34 public IntPtr Handle {
\r
35 get { return (IntPtr) _coll.GetHashCode (); }
\r
38 public X509CertificateCollection GetCollection ()
\r
40 if (_flags == X509CertificateStore.StoreOpenFlags.ReadOnly) {
\r
41 // return a copy of the collection so changes aren't persisted
\r
42 X509CertificateCollection copy = new X509CertificateCollection ();
\r
43 foreach (X509Certificate x in _coll) {
\r