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); }
public bool VerifyMd5Hash(string hashHex, string signedHash) { byte[] signedBytes = BasicHasher.ConvertFromHexOrBase64(signedHash); return(this.VerifyMd5Hash(hashHex, signedBytes)); }
// ---------- public bool VerifyHash(string hashHex, string signedHash, string algorithm) { byte[] signedBytes = BasicHasher.ConvertFromHexOrBase64(signedHash); return(this.VerifyHash(hashHex, signedBytes, algorithm)); }