Beispiel #1
0
 private static void Remove9(global::System.IntPtr @__envp, global::net.sf.jni4net.utils.JniLocalHandle @__obj, global::net.sf.jni4net.utils.JniLocalHandle value)
 {
     // (Lsystem/Object;)V
     // (LSystem/Object;)V
     global::net.sf.jni4net.jni.JNIEnv @__env = global::net.sf.jni4net.jni.JNIEnv.Wrap(@__envp);
     try {
         global::System.Collections.IList @__real = global::net.sf.jni4net.utils.Convertor.FullJ2C <global::System.Collections.IList>(@__env, @__obj);
         @__real.Remove(global::net.sf.jni4net.utils.Convertor.FullJ2C <object>(@__env, value));
     }catch (global::System.Exception __ex) { @__env.ThrowExisting(__ex); }
 }
        public static PgpSecretKeyRingBundle RemoveSecretKeyRing(PgpSecretKeyRingBundle bundle, PgpSecretKeyRing secretKeyRing)
        {
            //IL_0024: Unknown result type (might be due to invalid IL or missing references)
            long keyId = secretKeyRing.GetPublicKey().KeyId;

            if (!bundle.secretRings.Contains((object)keyId))
            {
                throw new ArgumentException("Collection does not contain a key with a keyId for the passed in ring.");
            }
            IDictionary val = Platform.CreateHashtable(bundle.secretRings);

            global::System.Collections.IList list = Platform.CreateArrayList((global::System.Collections.ICollection)bundle.order);
            val.Remove((object)keyId);
            list.Remove((object)keyId);
            return(new PgpSecretKeyRingBundle(val, list));
        }
Beispiel #3
0
        private static PgpPublicKey RemoveCert(PgpPublicKey key, object id, PgpSignature certification)
        {
            PgpPublicKey pgpPublicKey = new PgpPublicKey(key);
            bool         flag         = false;

            for (int i = 0; i < ((global::System.Collections.ICollection)pgpPublicKey.ids).get_Count(); i++)
            {
                if (id.Equals(pgpPublicKey.ids.get_Item(i)))
                {
                    global::System.Collections.IList list = (global::System.Collections.IList)pgpPublicKey.idSigs.get_Item(i);
                    flag = list.Contains((object)certification);
                    if (flag)
                    {
                        list.Remove((object)certification);
                    }
                }
            }
            if (!flag)
            {
                return(null);
            }
            return(pgpPublicKey);
        }
Beispiel #4
0
        private PkixCertPathBuilderResult Build(IX509AttributeCertificate attrCert, X509Certificate tbvCert, PkixBuilderParameters pkixParams, global::System.Collections.IList tbvPath)
        {
            if (tbvPath.Contains((object)tbvCert))
            {
                return(null);
            }
            if (pkixParams.GetExcludedCerts().Contains(tbvCert))
            {
                return(null);
            }
            if (pkixParams.MaxPathLength != -1 && ((global::System.Collections.ICollection)tbvPath).get_Count() - 1 > pkixParams.MaxPathLength)
            {
                return(null);
            }
            tbvPath.Add((object)tbvCert);
            PkixCertPathBuilderResult pkixCertPathBuilderResult = null;
            PkixAttrCertPathValidator pkixAttrCertPathValidator = new PkixAttrCertPathValidator();

            try
            {
                if (PkixCertPathValidatorUtilities.FindTrustAnchor(tbvCert, pkixParams.GetTrustAnchors()) != null)
                {
                    PkixCertPath certPath = new PkixCertPath((global::System.Collections.ICollection)tbvPath);
                    PkixCertPathValidatorResult pkixCertPathValidatorResult;
                    try
                    {
                        pkixCertPathValidatorResult = pkixAttrCertPathValidator.Validate(certPath, pkixParams);
                    }
                    catch (global::System.Exception ex)
                    {
                        throw new global::System.Exception("Certification path could not be validated.", ex);
                    }
                    return(new PkixCertPathBuilderResult(certPath, pkixCertPathValidatorResult.TrustAnchor, pkixCertPathValidatorResult.PolicyTree, pkixCertPathValidatorResult.SubjectPublicKey));
                }
                try
                {
                    PkixCertPathValidatorUtilities.AddAdditionalStoresFromAltNames(tbvCert, pkixParams);
                }
                catch (CertificateParsingException ex2)
                {
                    throw new global::System.Exception("No additional X.509 stores can be added from certificate locations.", (global::System.Exception)ex2);
                }
                ISet set = new HashSet();
                try
                {
                    set.AddAll((global::System.Collections.IEnumerable)PkixCertPathValidatorUtilities.FindIssuerCerts(tbvCert, pkixParams));
                }
                catch (global::System.Exception ex3)
                {
                    throw new global::System.Exception("Cannot find issuer certificate for certificate in certification path.", ex3);
                }
                if (set.IsEmpty)
                {
                    throw new global::System.Exception("No issuer certificate for certificate in certification path found.");
                }
                global::System.Collections.IEnumerator enumerator = ((global::System.Collections.IEnumerable)set).GetEnumerator();
                try
                {
                    while (enumerator.MoveNext())
                    {
                        X509Certificate x509Certificate = (X509Certificate)enumerator.get_Current();
                        if (!PkixCertPathValidatorUtilities.IsSelfIssued(x509Certificate))
                        {
                            pkixCertPathBuilderResult = Build(attrCert, x509Certificate, pkixParams, tbvPath);
                            if (pkixCertPathBuilderResult != null)
                            {
                                break;
                            }
                        }
                    }
                }
                finally
                {
                    global::System.IDisposable disposable = enumerator as global::System.IDisposable;
                    if (disposable != null)
                    {
                        disposable.Dispose();
                    }
                }
            }
            catch (global::System.Exception ex4)
            {
                certPathException = new global::System.Exception("No valid certification path could be build.", ex4);
            }
            if (pkixCertPathBuilderResult == null)
            {
                tbvPath.Remove((object)tbvCert);
            }
            return(pkixCertPathBuilderResult);
        }
Beispiel #5
0
 public virtual void Remove(object k)
 {
     hash.Remove(k);
     keys.Remove(k);
 }
 public virtual void RemoveChild(PkixPolicyNode child)
 {
     mChildren.Remove((object)child);
 }