Exemple #1
0
        public bool Equivalent(X509Name other, bool inOrder)
        {
            if (!inOrder)
            {
                return(this.Equivalent(other));
            }
            if (other == null)
            {
                return(false);
            }
            if (other == this)
            {
                return(true);
            }
            int count = this.ordering.Count;

            if (count != other.ordering.Count)
            {
                return(false);
            }
            for (int i = 0; i < count; i++)
            {
                DerObjectIdentifier derObjectIdentifier = (DerObjectIdentifier)this.ordering[i];
                DerObjectIdentifier obj = (DerObjectIdentifier)other.ordering[i];
                if (!derObjectIdentifier.Equals(obj))
                {
                    return(false);
                }
                string s  = (string)this.values[i];
                string s2 = (string)other.values[i];
                if (!X509Name.equivalentStrings(s, s2))
                {
                    return(false);
                }
            }
            return(true);
        }
Exemple #2
0
        public bool Equivalent(X509Name other)
        {
            if (other == null)
            {
                return(false);
            }
            if (other == this)
            {
                return(true);
            }
            int count = this.ordering.Count;

            if (count != other.ordering.Count)
            {
                return(false);
            }
            bool[] array = new bool[count];
            int    num;
            int    num2;
            int    num3;

            if (this.ordering[0].Equals(other.ordering[0]))
            {
                num  = 0;
                num2 = count;
                num3 = 1;
            }
            else
            {
                num  = count - 1;
                num2 = -1;
                num3 = -1;
            }
            for (int num4 = num; num4 != num2; num4 += num3)
            {
                bool flag = false;
                DerObjectIdentifier derObjectIdentifier = (DerObjectIdentifier)this.ordering[num4];
                string s = (string)this.values[num4];
                for (int i = 0; i < count; i++)
                {
                    if (!array[i])
                    {
                        DerObjectIdentifier obj = (DerObjectIdentifier)other.ordering[i];
                        if (derObjectIdentifier.Equals(obj))
                        {
                            string s2 = (string)other.values[i];
                            if (X509Name.equivalentStrings(s, s2))
                            {
                                array[i] = true;
                                flag     = true;
                                break;
                            }
                        }
                    }
                }
                if (!flag)
                {
                    return(false);
                }
            }
            return(true);
        }