CryptImportKey gives error NTE_BAD_VER

When I call CryptImportKey() to import a public key which is exported  from another key store, it gives error NTE_BAD_VER. Any idea what went wrong ?
walterwkhAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
ee_autoConnect With a Mentor Commented:
Question PAQ'd, 500 points refunded, and stored in the solution database.
0
 
jkrCommented:
At first glance, I'd tend to say that the CSP's versions don't match. As with http://msdn2.microsoft.com/en-us/library/aa380207.aspx ("CryptImportKey"):

NTE_BAD_VER
The version number of the key BLOB does not match the CSP version. This usually indicates that the CSP needs to be upgraded.
 
0
 
walterwkhAuthor Commented:
yes, I've already gone through the page when i get the error, but how to fix it ?
0
 
jkrCommented:
Check the version of the CSPs involved and update accordingly...
0
 
walterwkhAuthor Commented:
sorry jkr, just discovered that it's because I am managing wrongly with the pointer to the keyblob, that's caused this error.

Thanks a lot anyway
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.