I use some win32 api create a pravite/public key pair and write them to files. that i do:
CryptGenKey(hProv, CALG_RSA_KEYX, KEYLENGTH | CRYPT_EXPORTABLE | CRYPT_NO_SALT, &hSessionKey);
// export private key buffer and write it to file
CryptExportKey(hSessionKey, NULL, PRIVATEKEYBLOB, 0, key_buf, &keySize ); //export private
key
//export public key buffer and write it to file
CryptExportKey(hSessionKey, NULL, PRIVATEKEYBLOB, 0, key_buf, &keySize );
That are no problem, and my question is how can i import the key from private key file, and encrypt data use that key; And import public key from public file to decrypt that encrypted data;
how can do ? thanks...