Closed ocelhay closed 1 year ago
You are mixing up different formats. rsa_encrypt
does raw encryption of small blobs using an RSA key.
However, you are using PKCS7, which is a container format that requires a certificate to encrypt (not just a public key). How did you convert your RSA key to a certificate exactly?
Thanks, indeed I was mixing things up. I could find an encryption that worked for us.
I've also added the ability to decrypt pkcs7 format if you are still interested: https://github.com/jeroen/openssl/commit/c1fe346538912707170d7bd3759b110425ab43c3
I think that
res$encryptedDOB
has been created with the commandecho "yyyy-mm-dd" | openssl smime -encrypt -aes-256-cbc -outform PEM tlfb_dob-public-key.pem > tlfb_dob_inline.enc
What is wrong with the above attempt to decrypt using my private key?