Exemplo n.º 1
0
 public static byte[] Sign(byte[] input, CngKey key, CngAlgorithm hash, int saltSize)
 {
     byte[] numArray;
     using (HashAlgorithm hashAlgorithm = RsaPss.HashAlgorithm(hash))
     {
         numArray = RsaPss.SignHash(hashAlgorithm.ComputeHash(input), key, hash.Algorithm, saltSize);
     }
     return(numArray);
 }
Exemplo n.º 2
0
        public static bool Verify(byte[] securedInput, byte[] signature, CngKey key, CngAlgorithm hash, int saltSize)
        {
            bool flag;

            using (HashAlgorithm hashAlgorithm = RsaPss.HashAlgorithm(hash))
            {
                flag = RsaPss.VerifyHash(hashAlgorithm.ComputeHash(securedInput), signature, key, hash.Algorithm, saltSize);
            }
            return(flag);
        }