Esempio n. 1
0
        public bool Equals(PrivateKey other)
        {
            if (!base.Equals(other))
            {
                return(false);
            }

            if (!KeyUtility.IsEqual(p, other.p))
            {
                return(false);
            }
            if (!KeyUtility.IsEqual(q, other.q))
            {
                return(false);
            }
            if (!KeyUtility.IsEqual(dp, other.dp))
            {
                return(false);
            }
            if (!KeyUtility.IsEqual(dq, other.dq))
            {
                return(false);
            }
            if (!KeyUtility.IsEqual(inverseQ, other.inverseQ))
            {
                return(false);
            }
            if (!KeyUtility.IsEqual(d, other.d))
            {
                return(false);
            }

            return(true);
        }
Esempio n. 2
0
 public PrivateKey(
     string modulusInBase64, string exponentInBase64,
     string pInBase64, string qInBase64,
     string dPInBase64, string dQInBase64,
     string inverseQInBase64, string dInBase64)
     : base(modulusInBase64, exponentInBase64)
 {
     p        = KeyUtility.GetBytes(pInBase64);
     q        = KeyUtility.GetBytes(qInBase64);
     dp       = KeyUtility.GetBytes(dPInBase64);
     dq       = KeyUtility.GetBytes(dQInBase64);
     inverseQ = KeyUtility.GetBytes(inverseQInBase64);
     d        = KeyUtility.GetBytes(dInBase64);
 }
Esempio n. 3
0
        public bool Equals(PublicKey other)
        {
            if (other == null)
            {
                return(false);
            }

            if (!KeyUtility.IsEqual(modulus, other.modulus))
            {
                return(false);
            }
            if (!KeyUtility.IsEqual(exponent, other.exponent))
            {
                return(false);
            }

            return(true);
        }
Esempio n. 4
0
        public bool Equals(SymmetricKey other)
        {
            if (other == null)
            {
                return(false);
            }

            if (!KeyUtility.IsEqual(key, other.key))
            {
                return(false);
            }
            if (!KeyUtility.IsEqual(iv, other.iv))
            {
                return(false);
            }

            return(true);
        }
Esempio n. 5
0
 public PublicKey(string modulusInBase64, string exponentInBase64)
 {
     modulus  = KeyUtility.GetBytes(modulusInBase64);
     exponent = KeyUtility.GetBytes(exponentInBase64);
 }