System.Security.Cryptography.X509Certificates.X509Certificate.GetSerialNumber C# (CSharp) Method

GetSerialNumber() public method

public GetSerialNumber ( ) : byte[]
return byte[]
        public virtual byte[] GetSerialNumber()
        {
            ThrowIfInvalid();

            return GetRawSerialNumber().CloneByteArray();
        }

Usage Example

Exemplo n.º 1
0
        public virtual bool Equals(X509Certificate other)
        {
            if (other == null)
            {
                return(false);
            }

            if (Pal == null)
            {
                return(other.Pal == null);
            }

            if (!Issuer.Equals(other.Issuer))
            {
                return(false);
            }

            byte[] thisSerialNumber  = GetSerialNumber();
            byte[] otherSerialNumber = other.GetSerialNumber();
            if (thisSerialNumber.Length != otherSerialNumber.Length)
            {
                return(false);
            }
            for (int i = 0; i < thisSerialNumber.Length; i++)
            {
                if (thisSerialNumber[i] != otherSerialNumber[i])
                {
                    return(false);
                }
            }

            return(true);
        }
All Usage Examples Of System.Security.Cryptography.X509Certificates.X509Certificate::GetSerialNumber