first af all, sorry for my english...
I'm trying to encrypt a plein text file with the same result obtained
using openssl.
1 - make a session key usign CryptGenKey(hProv, CALG_3DES_112,
CRYPT_EXPORTABLE, &hKey)
2 - import the current certificate public key with
CryptImportPublicKeyInfo
3 - export my session key with CryptExportKey obtaining a SIMPLEBLOB
4 - encrypt th pleintext with CryptEncrypt and the session key
Then I try to save in the output file the keyblob and the buffer
derived from CryptEncrypt, but the output file is not like the one
obtained using openssl rsautl -encrypt -in ... -out ... -inkey ...cer
-
certin -pkcs
I don't know what I'm doing wrong.
Thanks everybody