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

List:       ms-cryptoapi
Subject:    Re: About the key format
From:       Laszlo Elteto <lelteto () RAINBOW ! COM>
Date:       2002-11-07 21:03:04
[Download RAW message or body]

1. You don't say what blob type was asked first. Was it PRIVATEKEYBLOB? The
app may first asks for both key blob types before allocating memory for the
buffers.
2. As long as you are called with pbData=NULL you are just returning the
correct output length. (No matter how many times you are called.) Obviously,
you CANNOT return the actual blob as there's no parameter for it to pass
back to the caller.
3. Although CAPI doesn't require you to return EXACT output length it's
better to calculate the correct length and return that. Eg. for a public key
you calculate the header length, the three DWORDS for RSA header and the
modulus length. For private key blob in addition to the above you add
5*primelength + moduluslength (for the two primes, two exponents, the
modulus and the private exponent). So for a 1024-bit RSA key I think the
length of public key blob is
  8+12+128 = 148
and the length of private key blob is
  8+12+128+64+64+64+64+64+128 = 596

Laszlo Elteto
Fellow Scientist
Rainbow Technologies, Inc.

-----Original Message-----
From: Jesus Angel [mailto:jesus@SEGURIDATA.COM]
Sent: Thursday, November 07, 2002 11:57 AM
To: CryptoAPI@DISCUSS.MICROSOFT.COM
Subject: Re: About the key format


Thank you very much

Now  I have problems, how can I  use  the function CPExportKey
I  know that an application first  send me  pbData = NULL,  pdwDataLen = 0,
then   I change  the field  pbwDataLen = 1024,
but  next  CPExportKey  again  have  pbData = Null, pbDataLen =0.
I think in this second time,  I have to give the public keyt, because
 dwBlodType is  6 = PUBLICKBLOB.

what I have to do ?

thns

----------------------------------------------------------------
Users Guide http://discuss.microsoft.com/archives/mailfaq.asp
contains important info. Save time, search the archives at
http://discuss.microsoft.com/archives/index.html .
To unsubscribe, mailto:CryptoAPI-signoff-request@DISCUSS.MICROSOFT.COM

----------------------------------------------------------------
Users Guide http://discuss.microsoft.com/archives/mailfaq.asp
contains important info. Save time, search the archives at
http://discuss.microsoft.com/archives/index.html .
To unsubscribe, mailto:CryptoAPI-signoff-request@DISCUSS.MICROSOFT.COM
[prev in list] [next in list] [prev in thread] [next in thread] 

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