gpgsm: How do I import an unprotected key

Ingo Klöcker kloecker at kde.org
Tue Nov 10 21:35:13 CET 2026


On Montag, 9. November 2026 19:57:42 Mitteleuropäische Normalzeit Jakob Bohm 
via Gnupg-users wrote:
> Now the question that has hit further work is how to reliably import
> the unprotected decruption key into gpgsm.
> 
> Running gpgsm --import ${newkeyandcert}.p12 creates a state that will
> invoke gnupg-agent and prompt for a password, but refuse to accept
> blank input.
> 
> Running gpgsm --import ${newcert}.pem doesn't import the private key
> at all.
> 
> So what is the proper way to import a key and cert such that it is
> treated as unprotected by private key operations?

Using gpgsm 2.5.24 the following works for me.

$ echo | gpgsm --import --batch --pinentry-mode loopback --passphrase-fd 0 
cert.p12

After the import I could decrypt a message encrypted for this certificate 
without being asked for a password.

Regards,
Ingo
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 265 bytes
Desc: This is a digitally signed message part.
URL: <https://lists.gnupg.org/pipermail/gnupg-users/attachments/20261110/d4af9b0e/attachment.sig>


More information about the Gnupg-users mailing list