How to Import 3rd party generated AES private key ( openssl ) into CNG storage

Bingi Prasanthi 0 Reputation points
2023-09-12T08:55:42.1566667+00:00

Hi,

We are trying out the below scenario using CNG with Microsoft key storage provider in C++ builder 2007 IDE

Server side :

create openssl aes-256-cbc key and perform encryption on a secure file and share with the crypto container ( key id + AES key).

Client side :

Application will take the crypto container and store the AES key based on keyid into CNG storage .

In order to implement above, we have used NcryptImportKey with BCRYPT_KEY_DATA_BLOB as BLOB type on AES key provided by server ( which is generated using OPENSSL ), but the NcryptImportKey operation is failing with 0x80090009 , 0x80090029, 0x80090026 with different blob types.

can you please give us clarity on below aspects

  1. Is it possible to import/store 3rd party Linux (OPENSSL)based key into CNG storage?
  2. Is CNG support import operation in c++ builder 2006 IDE ( with default ncrypt.h, bcrypt.h, ncrypt.dll, bcrypt.dll which will come along with c++ builder 2006 installation )?
  3. If the above are feasible, can you please help us with which blob type we may need to use for importing openssl key to Microsoft KSP
Windows development | Windows API - Win32
Windows for business | Windows Client for IT Pros | Devices and deployment | Configure application groups
Windows for business | Windows Server | Storage high availability | Other
Windows for business | Windows Client for IT Pros | User experience | Other
Developer technologies | C++
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.