Secret key not available

Daniel Kahn Gillmor dkg at fifthhorseman.net
Fri May 25 16:26:58 CEST 2012


On 05/25/2012 09:39 AM, DUELL, BOB wrote:
> 1.  Attempting to decrypt a file that was sent to me by someone else, 
>     I get this message:
> 
>     gpg: decryption failed: secret key not available
> 
>     Could that mean the file was not encrypted with my public key?

yes, that is one plausible explanation.  Another possibility is that you
don't actually have your secret key on the computer you're currently using.

> 2.  Assuming the above it "yes", is there a command I can use to
>     display what key(s) were used to encrypt the file?

sure, you could use gpg --list-packets, and redirect standard input to
pull from the file in question:

0 dkg at pip:~$ gpg --list-packets < test.gpg
:pubkey enc packet: version 3, algo 1, keyid DF7B7722C193565B
	data: [2046 bits]
:encrypted data packet:
	length: 58
	mdc_method: 2
gpg: encrypted with 2048-bit RSA key, ID 0xDF7B7722C193565B, created
2011-11-07
      "Werner Koch <wk at gnupg.org>"
gpg: decryption failed: secret key not available
2 dkg at pip:~$

hth,

	--dkg

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 1030 bytes
Desc: OpenPGP digital signature
URL: </pipermail/attachments/20120525/2dd85059/attachment.pgp>


More information about the Gnupg-users mailing list