Example #1
0
        private static bool verifyHash(string text, byte[] signature)
        {
            var provider = (RSACryptoServiceProvider)getCertificate().PublicKey.Key;

            var hash = SHA1ManagedExample.HashData(text);

            return(provider.VerifyHash(hash, CryptoConfig.MapNameToOID("SHA1"), signature));
        }
Example #2
0
        private static byte[] signHash(string text)
        {
            var provider = (RSACryptoServiceProvider)getCertificate().PrivateKey;

            var hash = SHA1ManagedExample.HashData(text);

            return(provider.SignHash(hash, CryptoConfig.MapNameToOID("SHA1")));
        }