How to encrypt and sign with different keys

Dashamir Hoxha dashohoxha at
Mon Jul 18 22:49:17 CEST 2016

On Mon, Jul 18, 2016 at 9:40 PM, dom at <dom at> wrote:

> I am struggling with GPG command line that will encrypt file with key A
> and sign it with key B.

Usually it does it automatically, if you have subkeys for signing and

> Also, is there a way to provide the password for the signing key in the
> command line?

Try appending this to the command: `--passphrase-fd=0 <<< thepassphrase`

> I am trying to automate encrypting files.

Consider also using and customizing `egpg`:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: </pipermail/attachments/20160718/ef734ebb/attachment.html>

More information about the Gnupg-users mailing list