I'm receiving a CryptographicException "Bad Hash.\r\n" from the code below when I call CreateSignature
. Any ideas as to what might be causing this?
RSAPKCS1SignatureFormatter RSAFormatter =
new RSAPKCS1SignatureFormatter(new RSACryptoServiceProvider());
RSAFormatter.SetHashAlgorithm("SHA256");
byte[] signedHash = RSAFormatter.CreateSignature(myHash);