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

List:       ms-cryptoapi
Subject:    DSS Question
From:       Harry Whitehouse <harry () ENVMGR ! COM>
Date:       1998-03-19 22:54:55
[Download RAW message or body]


I'm having a ton of fun generating a DSS key set using CryptoAPI <g>!

Actually two questions have arisen.

1.  All of these calls work fine!

   if(!CryptGenKey(hProvDSS,AT_SIGNATURE,CRYPT_EXPORTABLE,&phKey))
   CryptGetKeyParam(phKey,KP_P,pbData,&cbData,0);
   CryptGetKeyParam(phKey,KP_Q,pbData,&cbData,0);
   CryptGetKeyParam(phKey,KP_G,pbData,&cbData,0);

except

  CryptGetKeyParam(phKey,KP_KEYLEN,(unsigned char *)&dData,&cbData,0);

which fails with NTE_BAD_TYPE.  Is KP_KEYLEN inappropriate in this
cirumstance because there are two keys, public and private?

2. I'm trying to store the public and private keys in disk files.

     rc=CryptExportKey(phKey,
                      0,
                      PRIVATEKEYBLOB,
                      0,
                      pbData,
                      &dData);

works just fine if pbData is NULL (returning what appears to be a valid
length).  However, if I allocate memory for pbData I get an error xEA
(which I can't find).  Can anyone give me a hint as to what I'm doing
wrong?

TIA

Harry

----------------------------------------------------------------
Users Guide http://www.microsoft.com/sitebuilder/resource/mailfaq.asp
contains important info including how to unsubscribe.  Save time, search
the archives at http://microsoft.ease.lsoft.com/archives/index.html

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

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