Problem with decrypting data
From: Tomek (tpiotr_at_op.pl)
Date: 10/08/04
- Next message: Trevor Barry: "Encrypt with .Net, decrypt with Crypto API?"
- Previous message: Hernan de Lahitte: "Re: .NET Applications and code access security"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Date: 8 Oct 2004 02:39:26 -0700
Hi,
I'm trying to encrypt and decrypt data using a smart card. I encrypted
data with RSACryptoServiceProvider.Encrypt function. The problem is
that decrypting data fails. I'm getting a CryptographicException and a
message: "Bad key".
When I encrypt I import to RSACryptoServiceProvider only an
information about exponent and modulus of a public key and it works.
When I decrypt I pass to RSACryptoServiceProvider all the parameters
of CspParams: provider type code, provider name, container name, it
fails (I used RSACryptoServiceProvider created in the same way when I
was signing XML files and everything was OK). In both cases I use the
same certificate. I also tried to use during the encryption process
RSACryptoServiceProvider created in the secend way but it didn't work.
I was getting a CryptographicException and a message: "An Internal
Error has occured". I'm in desperate. Can anybody help me?
- Next message: Trevor Barry: "Encrypt with .Net, decrypt with Crypto API?"
- Previous message: Hernan de Lahitte: "Re: .NET Applications and code access security"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|