resolution

From: Ellery Familia (ellery_AT_ellery.tv)
Date: 03/20/03


From: "Ellery Familia" <ellery_AT_ellery.tv>
Date: Thu, 20 Mar 2003 09:15:29 -0500


I solved this issue... the problem was that I was suppose to set the
PersistsCsp property of the RSACryptoServiceProvider to true.

--
Ellery Familia
www.universalmembers.com.
Dreams are necessary to life -Anais Nin
From: "Ellery Familia" <ellery AT ellery.tv>
Subject: strange RSACryptoServiceProvider issue
Date: Wednesday, March 19, 2003 11:02 AM
Blankthe code attempts to obtain the persisted CspParameters from the
application object, if it is successfully obtained, then the
RSACryptoServiceProvider it's instantiated, else, new parameters are created
and used. The problem is that the first time I try to use the "rsa" object,
a "BAD DATA" exception is thrown by the RSACryptoServiceProvider--as if the
keys did not match. The second time, the code works fine. Is there a bug in
the framework? No logical errors here.
//***************************************************************
cspParam = HttpContext.Current.Application["csp"] as CspParameters;
if(cspParam == null){
               cspParam = new CspParameters();
               cspParam.Flags = CspProviderFlags.UseMachineKeyStore;
               HttpContext.Current.Application.Add("csp",cspParam);
}
rsa = new RSACryptoServiceProvider(2048,cspParam);
//****************************************************************


Relevant Pages

  • private Key aus P12 Datei
    ... public string Sign(string TextToSign, string PrivateKey) ... RSACryptoServiceProvider rsaCryptoServiceProvider = new ... RSA RSA = RSA.Create; ... ASCIIEncoding Encoding = new ASCIIEncoding; ...
    (microsoft.public.de.german.entwickler.dotnet.csharp)
  • Re: CryptoAPI cryptographic service provider (CSP) for this implementation could not be acquired
    ... would imagine that you're having the same problem using des. ... CspParameters cspParam = new CspParameters; ... RSACryptoServiceProvider RSA = new RSACryptoServiceProvider; ... > used by ASP pages. ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • RE: Implementing RSACryptoServiceProvider *and* JavaScript
    ... One of the things I discovered is the 'standard' RSA algorithms, ... I've more-or-less come to the conclusion that the RSACryptoServiceProvider ... >> passwords and other sensitive information is passed from the client back to ... >> a JavaScript RSA implementation that works with the RSACryptoServiceProvider. ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • 2.0 breaking change. Cant figure it out.
    ... If you create a new RSA, ... private const int magic_size = 4; ... RSACryptoServiceProvider rsa = GetRSAFromSnkBytes; ... RSAParameters ret = new RSAParameters; ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Suggested additional constructor for RSACryptoServiceProvider
    ... Since we're on the subject of the RSACryptoServiceProvider class, ... generates new RSA public/private transient key-pairs each time invoked. ... creates a persistent key container with the name ... >> constructors support initializing with existing RSA credentials using ...
    (microsoft.public.dotnet.security)