ispiro
ispiro

Reputation: 27683

Why does RSACryptoServiceProvider.VerifyHash have a “hash algorithm identifier” parameter?

Since RSACryptoServiceProvider.VerifyHash verifies an already hashed message - why does it need to know which hash algorithm was used?

When asking about the SignHash method , it was suggested that the reason there is for communicating the hash (and not for actual use in the signing). But that won't explain it in this case. (since it's not an out parameter.)

Upvotes: 2

Views: 1311

Answers (1)

Nickolay Olshevsky
Nickolay Olshevsky

Reputation: 14160

That's because PKCS#1 encoding of signature includes hash function OID in RSA-encrypted data block.

Upvotes: 3

Related Questions