Solved

CryptImportKey gives error NTE_BAD_VER

Posted on 2007-12-06
6
1,210 Views
Last Modified: 2013-12-27
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 ?
0
Comment
Question by:walterwkh
  • 2
  • 2
6 Comments
 
LVL 86

Expert Comment

by:jkr
ID: 20425249
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
 

Author Comment

by:walterwkh
ID: 20426186
yes, I've already gone through the page when i get the error, but how to fix it ?
0
 
LVL 86

Expert Comment

by:jkr
ID: 20429232
Check the version of the CSPs involved and update accordingly...
0
 

Author Comment

by:walterwkh
ID: 20439299
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
 

Accepted Solution

by:
ee_auto earned 0 total points
ID: 25502877
Question PAQ'd, 500 points refunded, and stored in the solution database.
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
If you are anything like me, you install many apps on your phone and have your life on it, sometimes literally.  When I bought my current phone, a Samsung Galaxy S5 from Verizon, they were only selling the versions with 16 GB internal.  I didn't rea…
The goal of this video is to provide viewers with basic examples to understand opening and reading files in the C programming language.
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now