I have a file that will be encrypted at rest using GPG. I have the public and private keys for this file. I would like to send it to someone else. To do so, it must be encrypted using their (different) public key, so that they can decrypt it.
The easiest would be to: 1: decrypt with my key 2: write it to a temporary location 3: encrypt it with the other key
For security reasons, I can not write it to the temporary location because it won't be encrypted at that point. So, I would like to decrypt with my key and encrypt with the other key in one step, keeping the data in memory instead of writing it to a folder. Can this be done from the GPG command line?
I can't encrypt with my key and send them the public key to decrypt, it must start encrypted with my key and end up encrypted with their key.