Bypass Invalid Public key

Duwaine Robinson duwainer at
Mon Oct 6 15:40:06 CEST 2008

Thank you. I actually decided last week to verify whether the each key
is valid before I perform the encryption. I used the --list-keys command
along with a loop to accomplish this with ease.

Duwaine Robinson

-----Original Message-----
From: Peter Pentchev [mailto:roam at] 
Sent: Monday, October 06, 2008 5:33 AM
To: Duwaine Robinson
Cc: gnupg-users at
Subject: Re: Bypass Invalid Public key

On Mon, Oct 06, 2008 at 12:35:48PM +0300, Peter Pentchev wrote:
> On Thu, Oct 02, 2008 at 05:01:39PM -0500, Duwaine Robinson wrote:
> > Hi All,
> > 
> > Is there a way to get GnuPG to complete encryption, if there is at 
> > least one valid public key specified? I am trying automate my 
> > encryption process, and I am hoping to be able to get away with not 
> > having to specify error handling if one or more of my public keys 
> > does not exist on the key ring.
> > 
> > Any help is greatly appreciated.
> > Thank you
> I'm not sure that what you're asking would be such a good idea; after 
> all, it boils down to "let GnuPG report success even if it did not 
> really do most of what you asked it to, with no real way of knowing 
> which parts it did do and which parts it didn't" :)

Oookay, okay, I know, I know, I know - you *can* try running GnuPG on
the *encrypted* file later and find out which keys it is actually
encrypted to, but in my book, that goes under "nonsensical effort".

[almost snip my "--list-keys --with-colons output processing"
>   gpg --list-keys --with-colons 16194553 87E057BE 5DBFAB91
>   awk -F: '$1 == "pub" && $12 ~ /E/ { print $5 }'

That part still stands :)


Peter Pentchev	roam at    roam at    roam at
PGP key:
Key fingerprint	FDBA FD79 C26F 3C51 C95E  DF9E ED18 B68D 1619 4553
This would easier understand fewer had omitted.

More information about the Gnupg-users mailing list