Encrypt with public key from stdin/file possible?

David Shaw dshaw at jabberwocky.com
Wed Apr 13 17:07:39 CEST 2005

On Wed, Apr 13, 2005 at 02:19:04PM +0200, Sargon wrote:
> Hi
> I have a public key of a recipient in ASCII or binary form and would
> like to feed gpg w/o importing it first in its public keyring and
> afterwards specify the ID of the public key. According to my
> researches on the net and on the gnupg.org site, there's no way to do
> this though.
> Can anyone confirm this?

You can't do it without importing the key, but you can sort of fake
what you want.  Do something like:

  gpg --no-default-keyring --keyring ./tempkeyring.gpg --import  (thekey)
  gpg --no-default-keyring --keyring ./tempkeyring.gpg --encrypt  ......
  rm tempkeyring.gpg


More information about the Gnupg-users mailing list