Using RSA from ASP.NET
From: Kevin Burton (rkevinburton@charter.net)
Date: 02/13/03
- Next message: David Allen: "VB .Net Security Question"
- Previous message: Luyan: "Re: client certificate issue"
- In reply to: Kevin Burton: "Using RSA from ASP.NET"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
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
>.
>
- Next message: David Allen: "VB .Net Security Question"
- Previous message: Luyan: "Re: client certificate issue"
- In reply to: Kevin Burton: "Using RSA from ASP.NET"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|