Example #1
0
        /**
         * Checks if the signature is valid (transaction has not been tampered with).
         * It uses the fromAddress as the public key.
         *
         * @returns {boolean}
         */
        public bool IsValid()
        {
            try
            {
                if (this.signature == null)
                {
                    return(false);
                }

                if (this.signature.Length == 0)
                {
                    return(false);
                }

                // check the fromAccount is the signingKey
                string error;
                if (!CryptoKeyUtility.IsValidSignature(signature, encryptKey, initVector, fromAccount, out error))
                {
                    return(false);
                }

                return(true);
            }
            catch
            {
                return(false);
            }
        }