Re: associating a cert with a private key

2010-03-28 Thread David Woodhouse
On Sat, 2010-03-27 at 22:41 -0700, sd dd wrote:
 
 haven't had any luck with this alias so far, thought I've try it one
 more time :)
  
 here is my understanding of a cert signing request, 
  client create a key pair, 
  send the public key to server for signing
  server send back the signed cert, 
  
 now, my question is, from the server response I am able to get a
 public key, then how do i associate the private key with this public
 key? any code example to do this?

I'm not entirely sure what you're trying to do.

Are you suggesting that you'll have submitted more than one signing
request at a time, so you'll have _many_ private keys lying around and
you don't know which one is associated with which response from the
server?

If so, perhaps the X509_check_private_key() function in
crypto/x509/x509_cmp.c may be relevant to you? You could iterate over
the available private keys, looking for one which matches the public key
in the certificate you get back from the server.

Or you could just keep better track of your outstanding requests? :)

-- 
David WoodhouseOpen Source Technology Centre
david.woodho...@intel.com  Intel Corporation

__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   majord...@openssl.org


Re: associating a cert with a private key

2010-03-28 Thread Michael S. Zick
On Sun March 28 2010, sd dd wrote:
 
 haven't had any luck with this alias so far, thought I've try it one more 
 time :)
 
  
 
 here is my understanding of a cert signing request, 
 
  client create a key pair, 
 
  send the public key to server for signing
 
  server send back the signed cert, 
 
  
 
 now, my question is, from the server response I am able to get a public key, 
 then how do i associate the private key with this public key? any code 
 example to do this?
 

In the above example, you only created a single private key -
The server response is associated with the only private key that you have.

So unless you discarded both the private key and the public key, you still have 
both.
And only one of each.  A 1 to 1 relationship.

---

Want to try re-stating your problem?

Mike
  
 
 thanks,
 
 landi
 
  
 
 _
 Hotmail is redefining busy with tools for the New Busy. Get more from your 
 inbox.
 http://www.windowslive.com/campaign/thenewbusy?ocid=PID27925::T:WLMTAGL:ON:WL:en-US:WM_HMP:032010_2


__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   majord...@openssl.org