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?
Ignus
"Ignus Fast" <ju...@no.com> wrote in message
news:eW6p2PpJ...@TK2MSFTNGP09.phx.gbl...
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" <ju...@no.com> ha scritto nel messaggio
news:eW6p2PpJ...@TK2MSFTNGP09.phx.gbl...
Ignus
"Cantelmo Software" <in...@cantelmosoftware.com> wrote in message
news:uUvdRZUK...@TK2MSFTNGP09.phx.gbl...
// 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" <ju...@no.com> wrote in message
news:eW6p2PpJ...@TK2MSFTNGP09.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
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" <in...@cantelmosoftware.com> wrote in message
news:e6nj9rbK...@TK2MSFTNGP14.phx.gbl...
HTH
Marcello
"Ignus Fast" <ju...@no.com> ha scritto nel messaggio
news:ujWsamdK...@TK2MSFTNGP12.phx.gbl...
Thanks, though!
Ignus
"Cantelmo Software" <in...@cantelmosoftware.com> wrote in message
news:uAMeX5g...@TK2MSFTNGP12.phx.gbl...
(pin dropping)
Ignus
"Ignus Fast" <ju...@no.com> wrote in message
news:%235JbNxK...@TK2MSFTNGP15.phx.gbl...
-Valery.
http://www.harper.no/valery
"Ignus Fast" <ju...@no.com> wrote in message
news:e8SvmdzK...@TK2MSFTNGP09.phx.gbl...
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
"Valery Pryamikov" <val...@harper.no> wrote in message
news:u5sk1K4K...@TK2MSFTNGP12.phx.gbl...
Ignus
"Ignus Fast" <ju...@no.com> wrote in message
news:eW6p2PpJ...@TK2MSFTNGP09.phx.gbl...
Ignus
"Ignus Fast" <ju...@no.com> wrote in message
news:OgRsQJAL...@TK2MSFTNGP09.phx.gbl...
--
Message posted via http://www.dotnetmonster.com
I'd like to especially thanks Microsoft, who doesn't really appear to
give a crap if people get stuff working or not, unless they pay.
I'd also like to thank the developers at Microsoft who assume we would
always want the RSACryptoServiceProvider to automatically waste a bunch of
processor time generating a random key, even if we just want to put our own
key in it for signature validation.
:-p
Ignus
"Suchita via DotNetMonster.com" <fo...@DotNetMonster.com> wrote in message
news:5cb7eeda772a49af...@DotNetMonster.com...