Re: Digital Signature

From: Michel Gallant (neutron_at_istar.ca)
Date: 04/27/04


Date: Tue, 27 Apr 2004 17:38:16 -0400

When you loaded the cert/key you generated with makecert it was placed
in a CSP "keycontainer".
If you know the name of that keycontainer, then you can use to to directly
instantiate an RSACryptoServiceProvider:

 const int AT_KEYEXCHANGE = 1;
 const int AT_SIGNATURE = 2;

 CspParameters cp = new CspParameters();
 cp.KeyContainerName = ContainerName;

 cp.KeyNumber = AT_SIGNATURE; //default keytype gen'd by makecert;
 RSACryptoServiceProvider rsa = new RSACryptoServiceProvider(cp);

and you are ready to sign with .NET classes.

You can find out what your keycontainers are several different ways.
Here's one way: http://www.jensign.com/JavaScience/dotnet/keypal
or, if you have MS JVM and like signed applets and CAPICOM:
   http://www.jensign.com/JavaScience/KeyContainerTool

- Mitch

"Nikhil Garewal" <anonymous@discussions.microsoft.com> wrote in message
news:59CF4E23-B5FB-400E-91F0-83465432148D@microsoft.com...
> I have created a cert file using makecert.exe & have loaded it to the IIS server, I want to create
a digital signature of a userID using my private key. I plav to use the RSACryptoServiceProvider
Clas but how do I pass the private key to it instead of it creating a new one.



Relevant Pages

  • Re: How to lock the use of assembly by other assemblies.
    ... used to securely hold/backup both your public/private RSA keypair, ... and the issuing CA never sees your private key (however W2k3 has new key-archival ... When your OS generates a keypair, either using a tool like makecert.exe, the CEnroll ... You could import it into a CryptoAPI keycontainer, lock it down with stronger DPAPI protection ...
    (microsoft.public.dotnet.security)
  • Re: How to lock the use of assembly by other assemblies.
    ... > can also specify a CryptoAPI keycontainer name in your source code ... > You can use the private key associated with any issued/installed X509 Certificate ... > by specifying the corresponding keycontainer for the cert. ...
    (microsoft.public.dotnet.security)
  • Re: CertEnumCertificatesInStore() and IE
    ... private key persists in its key container. ... keycontainer with same public key etc.. ... I have issued to myself a new certificate, ... I have imported it into Personal store, ...
    (microsoft.public.platformsdk.security)
  • Keycontainer in PocketPC
    ... webservice and a PocketPC and to exchange RSA encrypted data. ... obviously not the way to do it - MS recommends to use a keycontainer ... otherwise store a private key securely on a PocketPC? ...
    (microsoft.public.pocketpc.developer)