Ejemplo n.º 1
0
        /*
         * LexicographicalOrdering Implementation:
         */
        public int CompareTo(ECKeyPair other)
        {
            if (other == null)
            {
                return(1);
            }

            bool publicKeyCompare = !other.HasPrivateKey || !HasPrivateKey;

            var thisHex  = publicKeyCompare ? PublicKeyCompressed.ToHex() : PrivateKeyData.ToHex();
            var otherHex = publicKeyCompare ? other.PublicKeyCompressed.ToHex(): other.PrivateKeyData.ToHex();

            return(String.Compare(thisHex, otherHex, StringComparison.Ordinal));
        }