BraintreeEncryption.Library.BouncyCastle.Asn1.Asn1Set.Asn1Equals C# (CSharp) Method

Asn1Equals() protected method

protected Asn1Equals ( Asn1Object asn1Object ) : bool
asn1Object Asn1Object
return bool
        protected override bool Asn1Equals(
			Asn1Object asn1Object)
        {
            Asn1Set other = asn1Object as Asn1Set;

            if (other == null)
                return false;

            if (Count != other.Count)
            {
                return false;
            }

            IEnumerator s1 = GetEnumerator();
            IEnumerator s2 = other.GetEnumerator();

            while (s1.MoveNext() && s2.MoveNext())
            {
                Asn1Object o1 = GetCurrent(s1).ToAsn1Object();
                Asn1Object o2 = GetCurrent(s2).ToAsn1Object();

                if (!o1.Equals(o2))
                    return false;
            }

            return true;
        }