Exemple #1
0
        /// <summary>
        /// Verifies a signed hash against the unsigned version
        /// </summary>
        /// <param name="Hash">The unsigned hash (should be 64bit string)</param>
        /// <param name="SignedHash">The signed hash (should be 64bit string)</param>
        /// <param name="Key">The key to use in decryption</param>
        /// <returns>True if it is verified, false otherwise</returns>
        public bool VerifyHash(string Hash, string SignedHash, string Key)
        {
            Contract.Requires <NullReferenceException>(AsymmetricAlgorithms != null, "AsymmetricAlgorithms");
            IAsymmetric Found = AsymmetricAlgorithms.FirstOrDefault();

            if (Found == null)
            {
                throw new ArgumentException("No asymmetric encryption algorithm found");
            }
            return(Found.VerifyHash(Hash, SignedHash, Key));
        }