[prev in list] [next in list] [prev in thread] [next in thread] 

List:       ms-cryptoapi
Subject:    Re: About exporting public key
From:       Jeff Spelman <jeffspel () MICROSOFT ! COM>
Date:       1997-03-21 15:43:01
[Download RAW message or body]


Bondi
   There is no need to specify the CRYPT_EXPORTABLE flag when generating
the key if all you want to export is the public key, however you do need
to give the function an valid handle to a key and in the example below
it looks as though the handle to the key is 0.  Get the handle to the
key with CryptGetUserKey or CryptGenKey.
Jeff

> ----------
> From:         Bondi Ho[SMTP:cmsho@CS.CITYU.EDU.HK]
> Sent:         Friday, March 21, 1997 5:48 AM
> To:   CryptoAPI@LISTSERV.MSN.COM
> Subject:      About exporting public key
>
>         I've got trouble in exporting the public key to the keyblob.
> The following
> the my code :
>
> ============================================================
> HCRYPTKEY hKey=0;
>
> PBYTE pbKeyBlob;
> DWORD dwBlobLen;
>
>         // Determine the size of key blob
>         if(!CryptExportKey(hKey, 0, PUBLICKEYBLOB, 0, NULL,
> &dwBlobLen)) {
> ============================================================
>
> GetLastError() returns ERROR_INVALID_PARAMETER!!!
>
>         What's wrong for my code?
>
> Bondi
>

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic