Error: "unusable public key"

Alphax alphasigmax at
Wed Mar 22 03:57:24 CET 2006

Daniel Carrera wrote:
> Hello,
> I'm having another problem, again not in the FAQ:
> sql.gz: encryption failed: unusable public key   
> This happens when I try to encrypt a file with my public key.
> /path/to/.gnupg/pubring.gpg
> --------------------------------------------------------
> pub  1024D/42713DE9 2006-03-21 Daniel Carrera <daniel at>
> sub  2048g/F2EB9C97 2006-03-21
> I am trying to encrypt with the following command:
> $ gpg -a --homedir /path/to/.gnupg -r daniel at --batch -o
> sql.asc -e sql.gz
> Note: The '-e sql.gz' is for testing. I'll replace this by a pipe later.
> When I run this command from a PHP script I get this error:
> gpg: F2EB9C97: There is no indication that this key really belongs to
> the owner
> gpg: sql.gz: encryption failed: unusable public key

You haven't specified that the key is trusted in the local trustdb.
You'll need to either remote login and:

$ gpg --edit 0x42713DE9

Command> trust

Please decide how far you trust this user to correctly verify other
users' keys
(by looking at passports, checking fingerprints from different sources,

  1 = I don't know or won't say
  2 = I do NOT trust
  3 = I trust marginally
  4 = I trust fully
  5 = I trust ultimately
  m = back to the main menu

Your decision? 4

or add the option

--trust-model always

to your gpg exectution command, ie.

$ gpg -a --homedir /path/to/.gnupg --trust-model always -r
daniel at --batch -o sql.asc -e sql.gz

or add

trust-model always

to your .gnupg/gpg.conf file.

Alphax                      |   /"\
Encrypted Email Preferred   |   \ /     ASCII Ribbon Campaign
OpenPGP key ID: 0xF874C613  |    X   Against HTML email & vCards    |   / \
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 558 bytes
Desc: OpenPGP digital signature
Url : /pipermail/attachments/20060322/50181e0d/signature.pgp

More information about the Gnupg-users mailing list