Friday, May 31, 2013

RSACryptoServiceProvider.VerifyHash() throws exception “Object identifier (OID) is unknown”

 

The problem occurs when calling RSACryptoServiceProvider.VerifyHash() in .Net 3.5.1. Only on some servers. Ok on windows 7 and most windows 2008 servers. But fails on 2003, where there is a hotfix that works (http://support.microsoft.com/hotfix/KBHotfix.aspx?kbnum=968730&kbln=en-us), but the problem also occurs on some 2008 Servers (Standard and Enterprise R2) with .Net 3.5.1 installed.

The exception we get is "Object identifier (OID) is unknown" when calling the VerifyHash() with the second parameter containing "SHA256".
rsa.VerifyHash(computedCheckSum, "SHA256", documentSeal)

This function call fails in some .net20 enviroments (2003 and some 2008 servers), but works in all .net40 envirmont:
if (!rsa.VerifyHash(computedCheckSum, "SHA256", documentSeal)){}

This one works in both .net2 and .net4:
if (!rsa.VerifyHash(computedCheckSum, CryptoConfig.MapNameToOID("SHA256"), documentSeal)){}

1 comment:

  1. Check out our state-of-the-art LED roulette tables examine out|and take a look at} your luck. Free Bet Blackjack is a variation of the usual game of blackjack. Free Bet Blackjack allows you to double down and cut up … for free! If you select the free wager choices, the supplier will place a special lammer subsequent to your original wager. If you end up|you discover yourself} profitable the hand, you receives a commission as should you had made a standard cut up or double, despite the fact fact} that|although} you didn’t 카지노 put any additional money at risk.

    ReplyDelete