Re: Error instantiating RSACryptoServiceProvider
From: Ignus Fast (junk_at_no.com)
Date: 03/16/05
- Next message: Ignus Fast: "Re: RSACryptoServiceProvider"
- Previous message: Dominick Baier [DevelopMentor]: "Re: Custom IPrincipal and declarative security checking"
- In reply to: Ignus Fast: "Error instantiating RSACryptoServiceProvider"
- Next in thread: Cantelmo Software: "Re: Error instantiating RSACryptoServiceProvider"
- Reply: Cantelmo Software: "Re: Error instantiating RSACryptoServiceProvider"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Date: Tue, 15 Mar 2005 17:43:06 -0600
Anyone? This is kinda critical for me, and I'd really appreciate the
help. So far this just seems like nasty bugs in the 1.1 framework. The
SignedXml.CheckSignature() method compiles with and at runtime accepts an
X509Certificate.PublicKey property, but always returns false. Nice. So I
export the properties of this key to a new RSACryptoServiceProvider(), which
works just dandy locally, but won't work on my Windows 2000 server (error
mentioned below). I've tried adding the permissions on the RSA/MachineKeys
folder. I've even tried the following two asserts:
// SecurityPermission myPerm = new
// SecurityPermission(SecurityPermissionFlag.Assertion);
// myPerm.Assert();
And
// FileIOPermission myPerm = new
// FileIOPermission(FileIOPermissionAccess.AllAccess, @"C:\Documents and
Settings\All Users\Application Data\Microsoft\Crypto");
// myPerm.Assert();
ANYONE?!?! PLEASE HELP ME OUT!!
Ignus
"Ignus Fast" <junk@no.com> wrote in message
news:eW6p2PpJFHA.3960@TK2MSFTNGP09.phx.gbl...
> I'm trying to instantiate an RSACryptoServiceProvider in a web service,
> which works fine on my local machine. But when I move the web service out
> to my production server, it blows up with the following error:
>
> System.Security.Cryptography.CryptographicException: CryptoAPI
> cryptographic service provider (CSP) for this implementation could not be
> acquired.
> at System.Security.Cryptography.RSACryptoServiceProvider..ctor(Int32
> dwKeySize, CspParameters parameters, Boolean useDefaultKeySize)
> at
> System.Security.Cryptography.RSACryptoServiceProvider..ctor(CspParameters
> parameters)
>
>
> Things I've tried:
>
> Using a CspProviderFlags objects to use the MachineKeyStore:
>
> CspParameters cspParams = new CspParameters();
> cspParams.Flags = CspProviderFlags.UseMachineKeyStore;
> rsacsp = new RSACryptoServiceProvider(cspParams);
>
> Setting the ASPNET user to have full permissions to the MachineKeys
> folder.
>
> Originally I was just reading in the cert, then passing the
> X509Certificate.PublicKey to SignedXml.CheckSignature(). This I thought
> *should* have worked, since the CheckSignature method accepts an RSA, but
> it always returned false (both locally and on the remote server). So I'm
> exporting the 509Certificate.PublicKey data into an
> RSACryptoServiceProvider, which works fine with SignedXml.CheckSignature()
> locally, but always results in the above error on the remote server.
>
> Any suggestions?
>
>
>
- Next message: Ignus Fast: "Re: RSACryptoServiceProvider"
- Previous message: Dominick Baier [DevelopMentor]: "Re: Custom IPrincipal and declarative security checking"
- In reply to: Ignus Fast: "Error instantiating RSACryptoServiceProvider"
- Next in thread: Cantelmo Software: "Re: Error instantiating RSACryptoServiceProvider"
- Reply: Cantelmo Software: "Re: Error instantiating RSACryptoServiceProvider"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|