gpgsm: can't sign using 'email at gmail.com': No public key

Werner Koch wk at gnupg.org
Mon May 12 15:27:00 CEST 2025


On Sun, 11 May 2025 12:08, Nick said:

> Is it because --list-keys shows 0 for signed keys?

You are using "gpg --list-keys" (aka "gpg -k") this lists OpenPGP keys
and not S/MIME (i.e. X.509) keys.  For that you need to run "gpgsm
--list-keys" (or "gpgsm -k").  However, if you want to use a key for
signing you need the private (secret) key and thus it is better to use

  gpgsm --list-secret-keys

or shorter

  gpgsm -K

(note the capital 'K').  This lists only keys/certificates for which you
have the private (secret) key.

> gpgsm: can't sign using 'email at gmail.com <mailto:email at gmail.com>': No
> public key

The error message might be confusing, as it should show "no secret key"
but in your case it seems that you don't vene have the public key for
"email at gmail.com".

BTW, having mailto: as part of the mail address in angle brackets is not
the best idea: For gpg any many other tools this looks like the real
mail address is "mailto:email at gmail.com" and not "email at gmail.com".



Shalom-Salam,

   Werner

-- 
The pioneers of a warless world are the youth that
refuse military service.             - A. Einstein
-------------- next part --------------
A non-text attachment was scrubbed...
Name: openpgp-digital-signature.asc
Type: application/pgp-signature
Size: 247 bytes
Desc: not available
URL: <https://lists.gnupg.org/pipermail/gnupg-users/attachments/20250512/85a67434/attachment.sig>


More information about the Gnupg-users mailing list