Bad Key error since upgrading to .NET 2.0 Framework

T

timmmahh

Is anyone aware of changes implemented in .NET 2.0 that affect the
behaviour of the RSACryptoServiceProvider.Decrypt method?

After no problems with this whilst based on .NET 1.1, after the
upgrade this method constantly returns the 'Bad Key' exception. I
haven't made any code changes at all, so can only presume this to be a
compatibility issue (or some bad code that is now being rejected).

Has anyone encountered such issues?
 
T

timmmahh

Is anyone aware of changes implemented in .NET 2.0 that affect the
behaviour of the RSACryptoServiceProvider.Decrypt method?

After no problems with this whilst based on .NET 1.1, after the
upgrade this method constantly returns the 'Bad Key' exception. I
haven't made any code changes at all, so can only presume this to be a
compatibility issue (or some bad code that is now being rejected).

Has anyone encountered such issues?

There's nothing my annoying that someone explaining the exact
problem you have, and then not detailing what they did next so....

Instead of using the custom sink encryption code that I had to
implement due to
lack of support in .NET 1.1, I've removed all that manual code in
favour of the new
security support available to remoting in .NET 2.0.

Personally, I decided to set the new security parameter
(ensureSecurity) used by
the RemotingConfiguration.Configure method to false in the actual
code, and then
enable/disable via the configuration file. This seems much more
flexible, although
you must remember to set both your client and server .config files to
match.

You can set the type of security applied using the ProtectionLevel
configuration
switch. Personally, I left this to the default SignAndEncrypt.

Thanks,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top