Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I list information for a GnuPG encrypted message?

I'm still working with GPG, as in this post:

How do I encrypt plaintext with GnuPG?

What I need now is to be able to list various info (e.g. all recipients) of an encrypted message without necessarily decrypting it. I've seen links to different commands like "--list-only", but nothing seems to work. Does anyone have an authoritative reference (or any input really) on this?

Best.

EDIT #1: Clarification. --list-only will display all keys but your own (if it was encrypted to you). Basically I need to be able to determine if the item was encrypted to me so as to "file" it or take other action.

like image 428
humble_coder Avatar asked May 04 '11 02:05

humble_coder


1 Answers

In order to see all keys (that are not hidden) that a block of encrypted data was encrypted to - including your own - you could simply make your secret-keyring unavailable, via something like this:

gpg --no-default-keyring --secret-keyring /dev/null -a --list-only

That tells gpg to not use any default keyrings (--no-default-keyring) if an invalid/missing keyring is specified, and then goes on to specify an invalid/missing secret-keyring (--secret-keyring /dev/null)

like image 82
kylehuff Avatar answered Sep 20 '22 18:09

kylehuff