Non-interactive passphrase?

Jun 10, 2014 at 3:44 PM
Is there any way to use the GpgAPI and programatically pass the passphrase? I've tried the preset-passphrase options with the gpg-agent, but it still prompts me for the passphrase.

Jun 12, 2014 at 8:10 PM
Edited Jun 12, 2014 at 8:11 PM
If you define a method that send the passphrase without interaction with the user ; is it a problem ?

For example:
obj.AskPassphrase = delegate(AskPassphraseInfo info)
    return GpgInterface.GetSecureStringFromString("your passphrase here");
Jun 13, 2014 at 10:26 PM
I did that, but GPG4WIN still prompts for my passphrase:
        public static void DECRYPT(String file1, String file2)
            GpgInterface.ExePath = Properties.Settings.Default.GPGExePath;

            GpgDecrypt decrypt = new GpgDecrypt(file1, file2);

            decrypt.AskPassphrase = delegate(AskPassphraseInfo info)
                 return GpgInterface.GetSecureStringFromString("mypassphrase");

            GpgInterfaceResult result = decrypt.Execute();

Jun 23, 2014 at 7:04 PM
I don't know that much about delegates, but if I put a breakpoint on the return portion of my delegate, shouldn't the debugger stop there? It isn't. I can't tell if my AskPassphrase function is even being called.
Sep 30, 2014 at 7:45 AM
I have the same problem,too.
I have tried the delegate .... it still prompts ask me password.
Sep 30, 2014 at 11:22 AM
Finally I find the solution,the problem is we can't using GPG4WIN's gpg.exe.
It must the pure Gnupg.
You can download it via below.
Feb 10, 2016 at 7:45 PM
Edited Feb 10, 2016 at 7:46 PM
Which file are you using for windows? I tried gnupg-w32-2.1.9_20151009.exe from your like and still I'm getting prompted.
Apr 11 at 5:50 AM
I suggest you using gnupg non windows version.