Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Assume always-trust is yes/true in GPG cmd

Im using GPG to encrypt a file in ASP.NET, C#. My code executes the command using ProcessStartInfo, and gpg.exe executes, but I have an issue. GPG asks me to authorize always-trust with "y" as the option. I tried using "YES" as well (As suggested in GPG help, to assume "yes" for all questions), but that didn't work either.

The string that runs GPG is:

"gpg --armor --output fileOutput.gpg --recipient [email protected] --encrypt fileInput.xml --always-trust --yes"

The question that's prompted is:

It is NOT certain that the key belongs to the person named in the user ID. If you really know what you are doing, you may answer the next question with yes

Use this key anyway?

How can I ignore the question altogether, or force the answer to be true ("YES") without being prompted to confirm?

Thanks.

like image 776
iLevi Avatar asked Aug 29 '11 18:08

iLevi


1 Answers

add --always-trust as a command line argument to gpg to take the prompt away.

like image 64
daemonza Avatar answered Oct 12 '22 19:10

daemonza