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

Bingi Prasanthi 0 Reputation points


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 API - Win32
Windows API - Win32
A core set of Windows application programming interfaces (APIs) for desktop and server applications. Previously known as Win32 API.
2,218 questions
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,170 questions
Windows 10 Security
Windows 10 Security
Windows 10: A Microsoft operating system that runs on personal computers and tablets.Security: The precautions taken to guard against crime, attack, sabotage, espionage, or another threat.
2,490 questions
Windows Server Storage
Windows Server Storage
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.Storage: The hardware and software system used to retain data for subsequent retrieval.
591 questions
Windows 11
Windows 11
A Microsoft operating system designed for productivity, creativity, and ease of use.
5,938 questions
{count} votes