Re: Error instantiating RSACryptoServiceProvider

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Ignus Fast (junk_at_no.com)
Date: 03/21/05


Date: Mon, 21 Mar 2005 17:38:32 -0600


    Ping. Again. Has no-one really run into this? Does anyone from
Microsoft read these groups at all?!?!?!?

        Ignus

"Ignus Fast" <junk@no.com> wrote in message
news:OgRsQJALFHA.3336@TK2MSFTNGP09.phx.gbl...
> Please help me, I'm bleeding here! Problem outlined below:
>
> 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?
>>
>>
>>
>
>



Relevant Pages

  • Re: Error instantiating RSACryptoServiceProvider
    ... > I'm trying to instantiate an RSACryptoServiceProvider in a web service, ... But when I move the web service out ... > dwKeySize, CspParameters parameters, Boolean useDefaultKeySize) ... but always results in the above error on the remote server. ...
    (microsoft.public.dotnet.security)
  • Re: Error instantiating RSACryptoServiceProvider
    ... >> I'm trying to instantiate an RSACryptoServiceProvider in a web service, ... >> which works fine on my local machine. ... >> dwKeySize, CspParameters parameters, Boolean useDefaultKeySize) ... >> it always returned false (both locally and on the remote server). ...
    (microsoft.public.dotnet.security)
  • Re: Error instantiating RSACryptoServiceProvider
    ... >> I'm trying to instantiate an RSACryptoServiceProvider in a web service, ... >> which works fine on my local machine. ... >> dwKeySize, CspParameters parameters, Boolean useDefaultKeySize) ... >> it always returned false (both locally and on the remote server). ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: Error instantiating RSACryptoServiceProvider
    ... why it won't create the object, I'm not sure which security permission to ... >> I'm trying to instantiate an RSACryptoServiceProvider in a web service, ... >> dwKeySize, CspParameters parameters, Boolean useDefaultKeySize) ... >> it always returned false (both locally and on the remote server). ...
    (microsoft.public.dotnet.security)
  • Re: Error instantiating RSACryptoServiceProvider
    ... >> I'm trying to instantiate an RSACryptoServiceProvider in a web service, ... >> which works fine on my local machine. ... >> it always returned false (both locally and on the remote server). ...
    (microsoft.public.dotnet.security)