RE: How To Access Public Key Certificate

From: David Miller [MSFT] (dmiller_at_online.microsoft.com)
Date: 12/29/03


Date: Mon, 29 Dec 2003 10:56:05 -0800

Richard,

You may want to review the code example at http://msdn.microsoft.com/library/en-us/security/security/example_c_program_using_cryptencryptmessage_and_cryptdecryptmessage.asp for an example of encrypting a message using the public key of the recipient. As the comments suggest, it is likely you would want to extend the functionality of GetRecipientCert() to search for the specific recipient's certificate, but this may get you started.

Thanks,
David

This posting is provided "As Is" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm

     
     ----- Richard Grossman wrote: -----
     
     Hi,
     
     I want to implement PKI in a program.
     I use only default key container of windows I mean "My", "AdressBook" To
     store certificate.
     
     As I've understand (may be I wrong) "My" store certificate with private
     key. Store AdressBook store public certificate (without private key).
     
     I'm trying to encrypt (asymetric a short message) using the public key
     of a certifcate stored. I've tried to use the function
     CryptAcquireCertificatePrivateKey but It can't aquire context for
     certificate without private key associated.
     
     How can I aquire context or wich function I can call to get access to
     the handle of public key certificate?
     
     Thanks for help
     
     Richard
     
     



Relevant Pages

  • Problem Setting Up x.509 Certificates for WSE2.0
    ... I am having trouble following the instructions provided for the sample apps ... certificate store and the local machine certificate store snap-ins. ... MsdnWse2SecuritySamplesClient.cer (Client's public key) -> ...
    (microsoft.public.dotnet.framework.webservices.enhancements)
  • Re: exporting a public key using the cryptoapi
    ... key blob from a certificate, but it appears that your real purpose is to ... A .cer file is an entire certificate, not just a public key. ... consider these steps to go from a certificate context to a .cer file. ... Save the memory store to a .cer file. ...
    (microsoft.public.platformsdk.security)
  • Re: How To Access Public Key Certificate
    ... The certificate own only a public key and stored in the AdressBook ... I'm really stuck with assymetric encryption. ... > store certificate. ...
    (microsoft.public.platformsdk.security)
  • Re: Trusted Certificates
    ... public key (RSAPublicKey format). ... If you need to understand more about the various possible "public key" formats see: ... Of course you can store entire certificates. ... > thats true if I have the certificate. ...
    (microsoft.public.platformsdk.security)
  • Re: Certificates: Which store to add to?
    ... But before I can call the chaining function on the cert, ... or retrieve the public key, I first need to get the ... chain back to the root certificate). ... >You should not have to import the cert into any store, ...
    (microsoft.public.platformsdk.security)