How to select the appropriate private key to use?

Ramon F Herrera ramon at
Fri Dec 3 22:29:37 CET 2004

I am using the GPGme library to write a program that
will decrypt files.  The files to be decrypted are
encrypted with exactly one out of three possible keys.

When I decrypt those files interactively, gpg shows me what
key was used and I type the passphrase corresponding to that
particular key.  The problem is, I am not sure how to do
that within a program:

  - should I keep on trying the 3 private keys (passphrases)
    until one of them works? (trial and error)


  - is there any way to request the key from the file,
    in advance, and use the corresponding passphrase?


-Ramon F Herrera

More information about the Gnupg-devel mailing list