Example #1
0
        public bool VerifyHash(byte[] hashedBytes, string signedHash, string algorithm)
        {
            algorithm = BasicHasherAlgorithms.VerifyAndMapToAlogrithm(algorithm);
            BasicHasher.ValidateDigestLength(algorithm, hashedBytes);

            byte[] signedBytes = BasicHasher.ConvertFromHexOrBase64(signedHash);
            var    isValid     = _publicKey.VerifyHash(hashedBytes, algorithm, signedBytes);

#if DEBUG
            var hashHex = hashedBytes.ToHexString();
            Trace.WriteLine("VerifyHash\t" + hashHex + "\t" + algorithm + "\tsig\t" + signedHash + "\tresult\t" + isValid.ToString().ToLower());
#endif
            return(isValid);
        }
Example #2
0
 public bool VerifyMd5Hash(string hashHex, string signedHash)
 {
     byte[] signedBytes = BasicHasher.ConvertFromHexOrBase64(signedHash);
     return(this.VerifyMd5Hash(hashHex, signedBytes));
 }
Example #3
0
        // ----------

        public bool VerifyHash(string hashHex, string signedHash, string algorithm)
        {
            byte[] signedBytes = BasicHasher.ConvertFromHexOrBase64(signedHash);
            return(this.VerifyHash(hashHex, signedBytes, algorithm));
        }