scripting gpg

Jon Drukman jsd at
Thu May 5 02:19:00 CEST 2011

David Shaw <dshaw <at>> writes:

> You're looking for the "--trust-model always" option.  Add that to your
options, and the trust model
> becomes "if it's on my keyring, it's fully trusted".  It's up to you to make
sure that only keys that are fully
> trusted are on your keyring, of course. :)

Awesome, thanks.  This works (php):

system("/usr/bin/gpg --batch --yes --import /sites/config/public_key.asc");
system("/usr/bin/gpg --batch --yes --no-ask-cert-level --trust-model always
--output $filename.gpg --encrypt --recipient $recipient $filename > /tmp/gpg.log

More information about the Gnupg-users mailing list