Using RSA from ASP.NET

From: Kevin Burton (rkevinburton@charter.net)
Date: 02/13/03


From: "Kevin Burton" <rkevinburton@charter.net>
Date: Thu, 13 Feb 2003 08:55:52 -0800


As I suspected it was a permissions problem. Once I
changed the <processModel> to SYSTEM rather than MACHINE
the RSA.Create worked. So the question now is what
permission do I need to use RSA.Create. By changing to
SYSTEM I have given myself more permission than I want but
MACHINE is not enough. What can I do so I have just enough
permission?

Thank you

Kevin

>-----Original Message-----
>I am trying to use SignedXml from an ASP.NET web page but
>it seems to throw an exception. I can build a simple
>Windows Form that calls RSA.Create and I don't have any
>problem. But when I put virtually the identical code in
an
>ASP.NET application I get an exception at RSA.Create.
>The details are included below. Any idea how I work
around
>this problem. I need to be able to sign and/or encrypt
>data returned from this ASP.NET application but there is
>some permission problem that I don't understand.
>
>Thank you in advance for your help.
>
>Kevin Burton
>rkevinburton@charter.net
>
>
>Server Error in '/AMPOCScan' Application.
>----------------------------------------------------------
-
>---------------------
>
>CryptoAPI cryptographic service provider (CSP) for this
>implementation could not be acquired.
>Description: An unhandled exception occurred during the
>execution of the current web request. Please review the
>stack trace for more information about the error and
where
>it originated in the code.
>
>Exception Details:
>System.Security.Cryptography.CryptographicException:
>CryptoAPI cryptographic service provider (CSP) for this
>implementation could not be acquired.
>
>Source Error:
>
>
>Line 93: signedXml.AddReference
>(reference);
>Line 94:
>Line 95: RSA rsaKey = RSA.Create();
>Line 96: signedXml.SigningKey =
>rsaKey;
>Line 97: KeyInfo keyInfo = new
>KeyInfo();
>
>
>Source File: c:\projects\baxter\ampocscan\ampocscan.cs
>Line: 95
>
>Stack Trace:
>
>
>[CryptographicException: CryptoAPI cryptographic service
>provider (CSP) for this implementation could not be
>acquired.]
>
>System.Security.Cryptography.RSACryptoServiceProvider..cto
r
>(Int32 dwKeySize, CspParameters parameters, Boolean
>useDefaultKeySize) +870
>
>System.Security.Cryptography.RSACryptoServiceProvider..cto
r
>() +54
>
>[TargetInvocationException: Exception has been thrown by
>the target of an invocation.]
> System.Reflection.RuntimeConstructorInfo.InternalInvoke
>(BindingFlags invokeAttr, Binder binder, Object[]
>parameters, CultureInfo culture, Boolean isBinderDefault)
>+0
> System.Reflection.RuntimeConstructorInfo.Invoke
>(BindingFlags invokeAttr, Binder binder, Object[]
>parameters, CultureInfo culture) +509
>
System.Security.Cryptography.CryptoConfig.CreateFromName
>(String name, Object[] args) +418
> System.Security.Cryptography.RSA.Create(String
algName)
>+7
> System.Security.Cryptography.RSA.Create() +13
> Baxter.Stargate.AMPOCScan.GeneratePumpInfo() in
>c:\projects\baxter\ampocscan\ampocscan.cs:95
>
>Baxter.Stargate.AMPOCScan.Application_AcquireRequestState
>(Object source, EventArgs e) in
>c:\projects\baxter\ampocscan\ampocscan.cs:138
> System.Web.SyncEventExecutionStep.Execute() +60
> System.Web.HttpApplication.ExecuteStep(IExecutionStep
>step, Boolean& completedSynchronously) +87
>
>
>
>
>----------------------------------------------------------
-
>---------------------
>Version Information: Microsoft .NET Framework
>Version:1.0.3705.288; ASP.NET Version:1.0.3705.288
>.
>



Relevant Pages

  • Re: fopen permissions problem - PHP5 and RHEL4
    ... permissions problem, but I can't seem to resolve it and any help would ... I'm running PHP5 and Apache on RedHat Enterprise Linux 4. ... permission to write to the dir, ... I suspect PHP itself has some permssion stuff getting in the ...
    (comp.lang.php)
  • Re: mounting an MP3 player?
    ... /dev/da1: writable, no read permission ... Aha! ... you have a permissions problem. ... Looking into the source code for the file command, ...
    (freebsd-questions)
  • Re: Windows update error 0x8007F004
    ... You still have a permissions problem when connected to the domain. ... Translate: You do not have permission to update. ... Please contact your system administrator. ... I'm constantly getting the error 0x8007F004 on Win2003, Win2000, WinXP PCs and servers even if I log on as the administrator of the domain - which I guess eliminates the permission issue. ...
    (microsoft.public.windowsupdate)