Gossamer Forum
Home : General : Internet Technologies :

Using GPG (ne PGP) w/Script

Quote Reply
Using GPG (ne PGP) w/Script
I've got a Perl Script that gets form data writes it to a temp file, encrypts it w/ GPG then emails the file to me and deletes it from the server.

system('gpg -- homedir . --recipient "My Name" --output "temp.txt.gpg" --encrypt "temp.txt"');

Of course the script fails because GPG stops and asks a question about Trust.

The script basically wants to know if I want to use the Public Key anyway (answer is Y since it is mine. I imported it and only I can decrypt the messages - so why is it being such a freak about it... Argh!)

I have two questions if anybody can point me in the right direction.

1. is this because I can only set the trust level to 4 (fully) instead of 5 (ultimately) ?

2. or is this because they are using version 1.0.3 on my shared account ?

Based on the many, way-outdated FAQs I can find the answer is either 1, 2 or both. One says that you cannot set the trust level to 5 unless the secret key resides on the same server. Another says this is a bug in versions prior to 1.0.6 (GnuPG).

Possible half-ass solution I'm so famous for: is there a way to pass the answer to the GPG program from within the Perl Script? (example echo Y| gpg --encrypt yo stuff here).

Any help would be much appreciated.