Ejemplo n.º 1
0
        public void AddAndroidLookup()
        {
            var androidLookup = new MonoBtlsX509LookupAndroid();
            var lookup        = new MonoBtlsX509Lookup(this, MonoBtlsX509LookupType.MONO);

            lookup.AddMono(androidLookup);
        }
Ejemplo n.º 2
0
        public MonoBtlsX509Lookup AddLookup(MonoBtlsX509LookupType type)
        {
            if (lookupHash == null)
            {
                lookupHash = new Dictionary <IntPtr, MonoBtlsX509Lookup> ();
            }

            /*
             * X509_STORE_add_lookup() returns the same 'X509_LOOKUP *' for each
             * unique 'X509_LOOKUP_METHOD *' (which is supposed to be a static struct)
             * and we want to use the same managed object for each unique 'X509_LOOKUP *'.
             */
            var lookup       = new MonoBtlsX509Lookup(this, type);
            var nativeLookup = lookup.GetNativeLookup();

            if (lookupHash.ContainsKey(nativeLookup))
            {
                lookup.Dispose();
                lookup = lookupHash [nativeLookup];
            }
            else
            {
                lookupHash.Add(nativeLookup, lookup);
            }

            return(lookup);
        }
Ejemplo n.º 3
0
        public void AddCollection(X509CertificateCollection collection, MonoBtlsX509TrustKind trust)
        {
            var monoLookup = new MonoBtlsX509LookupMonoCollection(collection, trust);
            var lookup     = new MonoBtlsX509Lookup(this, MonoBtlsX509LookupType.MONO);

            lookup.AddMono(monoLookup);
        }
Ejemplo n.º 4
0
 internal void Install(MonoBtlsX509Lookup lookup)
 {
     if (this.lookup != null)
     {
         throw new InvalidOperationException();
     }
     this.lookup = lookup;
 }
Ejemplo n.º 5
0
        public void AddWinCryptoLookup(StoreLocation location)
        {
            var winCryptoLookup = new MonoBtlsX509LookupWinCrypto();

            winCryptoLookup.Location = location;
            var lookup = new MonoBtlsX509Lookup(this, MonoBtlsX509LookupType.MONO);

            lookup.AddMono(winCryptoLookup);
        }
Ejemplo n.º 6
0
		public void AddAndroidLookup ()
		{
			var androidLookup = new MonoBtlsX509LookupAndroid ();
			var lookup = new MonoBtlsX509Lookup (this, MonoBtlsX509LookupType.MONO);
			lookup.AddMono (androidLookup);
		}
Ejemplo n.º 7
0
		public void AddCollection (X509CertificateCollection collection, MonoBtlsX509TrustKind trust)
		{
			var monoLookup = new MonoBtlsX509LookupMonoCollection (collection, trust);
			var lookup = new MonoBtlsX509Lookup (this, MonoBtlsX509LookupType.MONO);
			lookup.AddMono (monoLookup);
		}
Ejemplo n.º 8
0
		public MonoBtlsX509Lookup AddLookup (MonoBtlsX509LookupType type)
		{
			if (lookupHash == null)
				lookupHash = new Dictionary<IntPtr,MonoBtlsX509Lookup> ();

			/*
			 * X509_STORE_add_lookup() returns the same 'X509_LOOKUP *' for each
			 * unique 'X509_LOOKUP_METHOD *' (which is supposed to be a static struct)
			 * and we want to use the same managed object for each unique 'X509_LOOKUP *'.
			*/
			var lookup = new MonoBtlsX509Lookup (this, type);
			var nativeLookup = lookup.GetNativeLookup ();
			if (lookupHash.ContainsKey (nativeLookup)) {
				lookup.Dispose ();
				lookup = lookupHash [nativeLookup];
			} else {
				lookupHash.Add (nativeLookup, lookup);
			}

			return lookup;
		}