about 'CryptDestroyKey' function!

Please support our C++ advertiser: Intel Parallel Studio Home
Reply

Join Date: Sep 2008
Posts: 4
Reputation: alanchan is an unknown quantity at this point 
Solved Threads: 0
alanchan alanchan is offline Offline
Newbie Poster

about 'CryptDestroyKey' function!

 
0
  #1
Sep 4th, 2008
I have some questions about using Cavium CSP, which need your kindness help.

According to the explain in MSDN, the function 'CryptDestroyKey' of CRYPTAPI
will not only destory the key handle, but also free the memory that the key
occupied.

But using Cavium CSP, the function does not free the memory. What is the
problem?

It is my code below. This circle will only run 64 times around, then it
fails because of lack of memory in Card.

  1. while(1)
  2. {
  3. if(!CryptImportPublicKeyInfo(hCryptProv,
  4. MY_ENCODING_TYPE,&(pCertContext->pCertInfo->SubjectPublicKeyInfo),&hPubKey))
  5. {
  6. cout<<hex<<GetLastError()<<endl;
  7. break;
  8. goto while_end;
  9. }
  10. else
  11. {
  12. bSuceess = TURE;
  13. }
  14.  
  15.  
  16.  
  17. while_end:
  18. if(hPubKey) CryptDestroyKey(hPubKey);
  19.  
  20.  
  21.  
  22. if(bSuceess){iSuccess++;}
  23. else{iFalse++;}
  24. }

Thank you for your help!
Last edited by cscgal; Sep 4th, 2008 at 3:43 am. Reason: Fixed code tags
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC