Org.BouncyCastle.X509.X509Certificate.Equals C# (CSharp) Method

Equals() public method

public Equals ( object obj ) : bool
obj object
return bool
        public override bool Equals(
            object obj)
        {
            if (obj == this)
                return true;

            X509Certificate other = obj as X509Certificate;

            if (other == null)
                return false;

            return c.Equals(other.c);

            // NB: May prefer this implementation of Equals if more than one certificate implementation in play
            //			return Arrays.AreEqual(this.GetEncoded(), other.GetEncoded());
        }

Usage Example

Example #1
0
        /// <summary>
        /// Checks whether specified certificate matches this certificate
        /// </summary>
        /// <param name="certificate">Certificate to be checked</param>
        /// <returns>Null if match cannot be performed, true if certificate matches, false otherwise</returns>
        public bool?Matches(BCX509.X509Certificate certificate)
        {
            if (certificate == null)
            {
                return(null);
            }

            return(certificate.Equals(CertUtils.ToBouncyCastleObject(this.Data)));
        }
All Usage Examples Of Org.BouncyCastle.X509.X509Certificate::Equals