Retrieve Public Key with CryptGetUserKey???

From: Eric (eric.h@netcourrier.com)
Date: 08/08/02


From: "Eric" <eric.h@netcourrier.com>
Date: Thu, 8 Aug 2002 11:47:56 +0200


Hello,

I am currently creating a high level set of crypto functions based on the MS
CAPI.(not CAPICOM...)
I have generated a Machine Container, an Exchange Key Pair (that will also
be used for signature).
Now I want to generate a session key and store it on the disk as a KEY BLOB.
For my testing purpose I would like to encrypt and decrypt this session key
only using the key pair I have previously created.
I know that normally, I would use the receiver's public asym key to encrypt
the session key and then send it to him so that he can decrypt it using his
private asym key.
As I understand, this(getting the receiver's pubilc key) can be done using
CryptImportKey but in my example I would only like to use my own key pair.

My question is, is there a way, using CryptGetUserKey (or another API
function) to get a handle to the Public Exchange Key and not the private
one?

Maybe I'm wrong but it seems like whether you specify AT_EXCHANGE or
AT_SIGNATURE, the handle that is retreived is corresponding to the private
key...

Thanks
Eric



Relevant Pages

  • Retrieve Public Key with CryptGetUserKey???
    ... I am currently creating a high level set of crypto functions based on the MS ... I have generated a Machine Container, an Exchange Key Pair (that will also ... Now I want to generate a session key and store it on the disk as a KEY BLOB. ... function) to get a handle to the Public Exchange Key and not the private ...
    (microsoft.public.win2000.security)
  • RE: Crypto API and Not W2K problem
    ... I was encrypting the session key blob with my own exchange key and trying. ... The program continues and decrypts the data correctly on the same OS. ...
    (microsoft.public.pocketpc.developer)
  • Crypto API and W2K problem
    ... CryptGenKey for the the exchange key ... Use the session key to encrypt the data ... Reads the exchange key blob ... CryptImportKey the exchange key ...
    (microsoft.public.pocketpc.developer)
  • Re: Resolving the crypto duplicity...
    ... Poul-Henning Kamp writes: ... > I would like to propose that we try to eliminate the private copies ... > of crypto functions in sys/opencrypto and instead focus on the ...
    (freebsd-arch)
  • Public Exchange key from cert
    ... I have got a test app that reads the recipient's public ... exchange key from a file and uses it to encrypt the ... session key. ...
    (microsoft.public.platformsdk.security)