예제 #1
0
 public void Close()
 {
     store = null;
     if (list != null)
     {
         list.Clear();
     }
 }
예제 #2
0
파일: X509Store.cs 프로젝트: nsivov/mono
 public void Close()
 {
     if (store != null)
     {
         store.Close();
         store = null;
     }
     if (list != null)
     {
         list.Clear();
     }
 }
예제 #3
0
        static MX.X509Crl CheckCrls(string subject, string ski, MX.X509Store store)
        {
            if (store == null)
            {
                return(null);
            }

            var crls = store.Crls;

            foreach (MX.X509Crl crl in crls)
            {
                if (crl.IssuerName == subject && (ski.Length == 0 || ski == GetAuthorityKeyIdentifier(crl)))
                {
                    return(crl);
                }
            }
            return(null);            // No CRL found
        }
예제 #4
0
        public void Open(OpenFlags flags)
        {
            if (String.IsNullOrEmpty(_name))
            {
                throw new CryptographicException(Locale.GetText("Invalid store name (null or empty)."));
            }

            /* keep existing Mono installations (pre 2.0) compatible with new stuff */
            string name;

            switch (_name)
            {
            case "Root":
                name = "Trust";
                break;

            default:
                name = _name;
                break;
            }

            bool create = ((flags & OpenFlags.OpenExistingOnly) != OpenFlags.OpenExistingOnly);

            store = Factory.Open(name, create);
            if (store == null)
            {
                throw new CryptographicException(Locale.GetText("Store {0} doesn't exists.", _name));
            }
            _flags = flags;

            foreach (MX.X509Certificate x in store.Certificates)
            {
                var cert2 = new X509Certificate2(x.RawData);
                cert2.PrivateKey = x.RSA;
                Certificates.Add(cert2);
            }
        }
예제 #5
0
		public void Open (OpenFlags flags)
		{
			if (String.IsNullOrEmpty (_name))
				throw new CryptographicException (Locale.GetText ("Invalid store name (null or empty)."));

			/* keep existing Mono installations (pre 2.0) compatible with new stuff */
			string name;
			switch (_name) {
			case "Root":
				name = "Trust";
				break;
			default:
				name = _name;
				break;
			}

			bool create = ((flags & OpenFlags.OpenExistingOnly) != OpenFlags.OpenExistingOnly);
			store = Factory.Open (name, create);
			if (store == null)
				throw new CryptographicException (Locale.GetText ("Store {0} doesn't exists.", _name));
			_flags = flags;

			foreach (MX.X509Certificate x in store.Certificates) {
				var cert2 = new X509Certificate2 (x.RawData);
				cert2.PrivateKey = x.RSA;
				Certificates.Add (cert2);
			}
		}
예제 #6
0
		public void Close () 
		{
			store = null;
			if (list != null)
				list.Clear ();
		}