|
security
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Error instantiating RSACryptoServiceProviderwhich 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? Anyone? Please, help me! :)
Ignus Show quoteHide quote "Ignus Fast" <j***@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? > > > Ping???
(pin dropping) Ignus Show quoteHide quote "Ignus Fast" <j***@no.com> wrote in message news:%235JbNxKKFHA.1812@TK2MSFTNGP15.phx.gbl... > Anyone? Please, help me! :) > > Ignus > > > "Ignus Fast" <j***@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? >> >> >> > > Hi Ignus,
What error did you get? (looking through your post I didn't find any error description). -Valery. http://www.harper.no/valery Show quoteHide quote "Ignus Fast" <j***@no.com> wrote in message news:e8SvmdzKFHA.3336@TK2MSFTNGP09.phx.gbl... > Ping??? > > (pin dropping) > > Ignus > > "Ignus Fast" <j***@no.com> wrote in message > news:%235JbNxKKFHA.1812@TK2MSFTNGP15.phx.gbl... >> Anyone? Please, help me! :) >> >> Ignus >> >> >> "Ignus Fast" <j***@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? >>> >>> >>> >> >> > > Sorry, it was in the original message a week ago:
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) The only tips I've seen online have been: Add permission to the folder C:\Documents and Settings\All Users\Application Data\Microsoft\Crypto\RSA\MachineKeys and add this code to initialize the RSACryptoServiceProvider: CspParameters cspParams = new CspParameters(); cspParams.Flags = CspProviderFlags.UseMachineKeyStore; rsacsp = new RSACryptoServiceProvider(cspParams); Neither of which had any affect. Any suggestions? Ignus Show quoteHide quote "Valery Pryamikov" <val***@harper.no> wrote in message news:u5sk1K4KFHA.3832@TK2MSFTNGP12.phx.gbl... > Hi Ignus, > What error did you get? (looking through your post I didn't find any error > description). > > -Valery. > http://www.harper.no/valery > > "Ignus Fast" <j***@no.com> wrote in message > news:e8SvmdzKFHA.3336@TK2MSFTNGP09.phx.gbl... >> Ping??? >> >> (pin dropping) >> >> Ignus >> >> "Ignus Fast" <j***@no.com> wrote in message >> news:%235JbNxKKFHA.1812@TK2MSFTNGP15.phx.gbl... >>> Anyone? Please, help me! :) >>> >>> Ignus >>> >>> >>> "Ignus Fast" <j***@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? >>>> >>>> >>>> >>> >>> >> >> > try with CAS (code access security) permission:
http://www.codeproject.com/dotnet/UB_CAS_NET.asp Marcello www.cantelmosoftware.com my articles: http://www.codeproject.com/dotnet/StackCrypt.asp http://www.codeproject.com/dotnet/Anti_BPX.asp try my .net obfuscator: http://xoomer.virgilio.it/cantelmosoftware/net/TryMe.zip Show quoteHide quote "Ignus Fast" <j***@no.com> ha scritto nel messaggio 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? > > > Love the article, but I'm not sure how to apply it. Since I'm not sure
why it won't create the object, I'm not sure which security permission to override? Ignus Show quoteHide quote "Cantelmo Software" <i***@cantelmosoftware.com> wrote in message news:uUvdRZUKFHA.3336@TK2MSFTNGP09.phx.gbl... > try with CAS (code access security) permission: > http://www.codeproject.com/dotnet/UB_CAS_NET.asp > > Marcello > www.cantelmosoftware.com > > my articles: > http://www.codeproject.com/dotnet/StackCrypt.asp > http://www.codeproject.com/dotnet/Anti_BPX.asp > > > try my .net obfuscator: > http://xoomer.virgilio.it/cantelmosoftware/net/TryMe.zip > > > "Ignus Fast" <j***@no.com> ha scritto nel messaggio > 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? >> >> >> > > 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 Show quoteHide quote "Ignus Fast" <j***@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? > > >
Show quote
Hide quote
"Ignus Fast" <j***@no.com> ha scritto nel messaggio sorry for my bad english! i'm italiannews:%2383o9ibKFHA.3420@tk2msftngp13.phx.gbl... > 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!! at the moment, before of "Assert" invoke the PermissionSet. example: Dim _set As New PermissionSet(PermissionState.None) _set.AddPermission(New FileIOPermission(PermissionState.Unrestricted)) _set.Assert Marcello Don't sweat the english; your english is fine! Thanks for the help!
I'm just new to the crypto scene, and it seems I couldn't have picked much tougher a project... Unfortunately this didn't work either. It doesn't seem to be a permissions thing; unfortunately, I'm not sure WHAT'S going on.... Any Microsoft people here??? Ignus Show quoteHide quote "Cantelmo Software" <i***@cantelmosoftware.com> wrote in message news:e6nj9rbKFHA.1948@TK2MSFTNGP14.phx.gbl... > > sorry for my bad english! i'm italian > at the moment, before of "Assert" invoke the PermissionSet. example: > > Dim _set As New PermissionSet(PermissionState.None) > _set.AddPermission(New FileIOPermission(PermissionState.Unrestricted)) > _set.Assert > > Marcello try this link:
http://support.microsoft.com/default.aspx?scid=kb;en-us;322371 HTH Marcello www.cantelmosoftware.com Show quoteHide quote "Ignus Fast" <j***@no.com> ha scritto nel messaggio news:ujWsamdKFHA.3132@TK2MSFTNGP12.phx.gbl... > Don't sweat the english; your english is fine! Thanks for the help! > > I'm just new to the crypto scene, and it seems I couldn't have picked > much tougher a project... Unfortunately this didn't work either. It > doesn't seem to be a permissions thing; unfortunately, I'm not sure WHAT'S > going on.... Any Microsoft people here??? > > Ignus > > "Cantelmo Software" <i***@cantelmosoftware.com> wrote in message > news:e6nj9rbKFHA.1948@TK2MSFTNGP14.phx.gbl... >> >> sorry for my bad english! i'm italian >> at the moment, before of "Assert" invoke the PermissionSet. example: >> >> Dim _set As New PermissionSet(PermissionState.None) >> _set.AddPermission(New FileIOPermission(PermissionState.Unrestricted)) >> _set.Assert >> >> Marcello > > Unfortunately, that was the first thing I tried. :(
Thanks, though! Ignus Show quoteHide quote "Cantelmo Software" <i***@cantelmosoftware.com> wrote in message news:uAMeX5gKFHA.732@TK2MSFTNGP12.phx.gbl... > try this link: > http://support.microsoft.com/default.aspx?scid=kb;en-us;322371 > > HTH > Marcello > > www.cantelmosoftware.com > > "Ignus Fast" <j***@no.com> ha scritto nel messaggio > news:ujWsamdKFHA.3132@TK2MSFTNGP12.phx.gbl... >> Don't sweat the english; your english is fine! Thanks for the help! >> >> I'm just new to the crypto scene, and it seems I couldn't have picked >> much tougher a project... Unfortunately this didn't work either. It >> doesn't seem to be a permissions thing; unfortunately, I'm not sure >> WHAT'S going on.... Any Microsoft people here??? >> >> Ignus >> >> "Cantelmo Software" <i***@cantelmosoftware.com> wrote in message >> news:e6nj9rbKFHA.1948@TK2MSFTNGP14.phx.gbl... >>> >>> sorry for my bad english! i'm italian >>> at the moment, before of "Assert" invoke the PermissionSet. example: >>> >>> Dim _set As New PermissionSet(PermissionState.None) >>> _set.AddPermission(New FileIOPermission(PermissionState.Unrestricted)) >>> _set.Assert >>> >>> Marcello >> >> > > Please help me, I'm bleeding here! Problem outlined below:
Ignus Show quoteHide quote "Ignus Fast" <j***@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? > > > Please help me, I'm bleeding here! Problem outlined below:
Ignus Show quoteHide quote "Ignus Fast" <j***@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? > > > Please help me, I'm bleeding here! Problem outlined below:
Ignus Show quoteHide quote "Ignus Fast" <j***@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? > > > Please help me, I'm bleeding here! Problem outlined below:
Ignus Show quoteHide quote "Ignus Fast" <j***@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? > > >
Other interesting topics
Error from CAS Config util
Newbie error on output Running programs located on server why i get UnauthorizedAccess Exception? best practice for encrypting in app Secure files on virtual Single-sign-on .NET GUI to J2EE server Assymetric encryption - building an interopable solution that works with .NET/Java/OpenSSL error when I use AES with CAPICOM Security Token: connect as |
|||||||||||||||||||||||