Certificate store: How en-/decryption with certificate private/public key?

Certificate store: How en-/decryption with certificate private/public key?

Post by MV » Fri, 01 Nov 2002 01:25:50



The best/easiest solution now is to use CAPICOM 2 functionality:
   http://www.microsoft.com/downloads/release.asp?ReleaseID=44155
(unless you have very unusual requirements, in which case you may
 need to use capi directly).

There are excellent samples in the CAPICOM 2 download for:
  asp,  c#,  C++,  html,  vb,  vbs

The CAPICOM  2 install is rather small :-) and is supported on
 Win98 - XP  (and also the 2.0.0.1 version seems to work in most
cases on Win95).

 - Michel Gallant
   MVP Security
   http://home.istar.ca/~neutron


> Hello,

> I want to use the key pair of a stored X509Certificate to encrypt and
> decrypt data.
> I haven't found a solution for a few problems I have:

> Is there a way to generate a X509Certificate of a keypair in a self written
> program with the windows api?
> How can I get the private key/public key belonging to a X509 certifcate
> (stored in the windows certificate store) and decrypt/encrypt some data with
> it?

> Examples will be nice!
> I prever a solution with .NET Framework or COM (capicom.dll), but C/C++-Code
> will also fine.

> Bye
> Andreas Siglreithmayr

 
 
 

Certificate store: How en-/decryption with certificate private/public key?

Post by MSDN Newsgroup » Fri, 01 Nov 2002 00:55:42


Hello,

I want to use the key pair of a stored X509Certificate to encrypt and
decrypt data.
I haven't found a solution for a few problems I have:

Is there a way to generate a X509Certificate of a keypair in a self written
program with the windows api?
How can I get the private key/public key belonging to a X509 certifcate
(stored in the windows certificate store) and decrypt/encrypt some data with
it?

Examples will be nice!
I prever a solution with .NET Framework or COM (capicom.dll), but C/C++-Code
will also fine.

Bye
Andreas Siglreithmayr

 
 
 

Certificate store: How en-/decryption with certificate private/public key?

Post by Sitarama » Wed, 06 Nov 2002 00:57:23


This is a good one to sign using X509 & XML Signature.
The verify program doent work and throwing an exception that
CertGetKey.dll is not found. Any thoughts on where i can get this from??

Thanks

Ram



> The best/easiest solution now is to use CAPICOM 2 functionality:
>    http://www.microsoft.com/downloads/release.asp?ReleaseID=44155
> (unless you have very unusual requirements, in which case you may
>  need to use capi directly).

> There are excellent samples in the CAPICOM 2 download for:
>   asp,  c#,  C++,  html,  vb,  vbs

> The CAPICOM  2 install is rather small :-) and is supported on
>  Win98 - XP  (and also the 2.0.0.1 version seems to work in most
> cases on Win95).

>  - Michel Gallant
>    MVP Security
>    http://home.istar.ca/~neutron


> > Hello,

> > I want to use the key pair of a stored X509Certificate to encrypt and
> > decrypt data.
> > I haven't found a solution for a few problems I have:

> > Is there a way to generate a X509Certificate of a keypair in a self
written
> > program with the windows api?
> > How can I get the private key/public key belonging to a X509 certifcate
> > (stored in the windows certificate store) and decrypt/encrypt some data
with
> > it?

> > Examples will be nice!
> > I prever a solution with .NET Framework or COM (capicom.dll), but
C/C++-Code
> > will also fine.

> > Bye
> > Andreas Siglreithmayr

 
 
 

1. Error: "cannot find the certificate and private key for decryption"

hi,

I try to sign a message using WSE and .Net, but I don't know why always the program shows me this error:

"cannot find the certificate and private key for decryption"

I have tried with many methods, put in the client configuration files the correct configuration, generate many certificates and put it in CurrentUser and LocalMachine... but neither function....

I am working in win 2003 rc2 and VS.Net 2003 Final Beta......

Thanks in advanced for any information......

2. My console wouldn't open up - have to reboot

3. How to extract private key of a server certificate?

4. Another Autodesk Product: 3D STUDIO MAX

5. HttpWebRequest client certificate private key problem (VB.NET 2002)

6. Looking for Math fonts

7. How to select an certificate from IE's certificate sote

8. may be forged, help

9. RSA Cryptography, storage of Private and Public Keys

10. Using an RSA key from an existing X509 certificate

11. Reversing RSA (Decrypt with Public Key, Encrypt with Private)

12. Public/Private Keys

13. .net certificate store access with P/Invoke and CAPICOM