From jb-gnumlists at wisemo.com Mon Nov 9 19:57:42 2026 From: jb-gnumlists at wisemo.com (Jakob Bohm) Date: Mon, 9 Nov 2026 19:57:42 +0100 Subject: gpgsm: How do I import an unprotected key Message-ID: <5c9e3be1-d60d-6910-b75f-141519eca379@wisemo.com> Dear list, I am using gpgsm in a scripted system that decrypts huge CMS/PKCS#7 messages delivered between servers. This means that there is no user interaction to unlock keys, not even at boot. Although interaction is allowed during certificate/key import A typical gpgsm invocation goes like this (script simplified for mail): #!/bin/bash ... fprint=$(openssl x509 -in "${sigcertpem}" -noout -fingerprint | perl -pe 's/^SHA1 Fingerprint=//i; s/://sg;') faketime "${ENCTSTAMP}" gpgsm --assume-binary --validation-model shell --disable-policy-checks --debug-level 7 --decrypt $encfile 2>/dev/null | tee $decfile | faketime "${SIGTSTAMP}" gpgsm --assume-binary --validation-model shell --disable-policy-checks --debug-level 7 --status-fd 3 --verify - 3>${tmppfx}.status 2>/dev/null ; then echo "Searching status file for ${fprint}..." >&2 if ( grep "^\[GNUPG:\] GOODSIG ${fprint}" ${tmppfx}.status && grep "^\[GNUPG:\] VALIDSIG ${fprint}" ${tmppfx}.status ) >/dev/null ; then rm ${tmppfx}.status echo "Success" >&2 exit 0 else rm ${tmppfx}.status echo "BadSig1" >&2 exit 2 fi else rm ${tmppfx}.status echo "BadSig2" >&2 exit 2 fi 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? Please state version differences in any answers. Enjoy Jakob -- Jakob Bohm, CIO, Partner, WiseMo A/S. https://www.wisemo.com Transformervej 29, 2860 Søborg, Denmark. Direct +45 31 13 16 10 This public discussion message is non-binding and may contain errors. WiseMo - Remote Service Management for PCs, Phones and Embedded From kloecker at kde.org Tue Nov 10 21:35:13 2026 From: kloecker at kde.org (Ingo =?UTF-8?B?S2zDtmNrZXI=?=) Date: Tue, 10 Nov 2026 21:35:13 +0100 Subject: gpgsm: How do I import an unprotected key In-Reply-To: <5c9e3be1-d60d-6910-b75f-141519eca379@wisemo.com> References: <5c9e3be1-d60d-6910-b75f-141519eca379@wisemo.com> Message-ID: 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: From julian at jtle.dk Tue Nov 10 22:41:09 2026 From: julian at jtle.dk (=?utf-8?q?Julian_J=C3=B8rgensen?=) Date: Tue, 10 Nov 2026 22:41:09 +0100 Subject: Rsync on ftp.gnupg.org Message-ID: Hi gnupg, I volunteer at the software mirror mirrors.dotsrc.org, which is listed at your mirror list. For the past 12 weeks we have been serving an out-of-date version of the mirror. We sync up against rsync://ftp.gnupg.org which, according to our logs, seems to have been offline for this time. Is this intentional, is mirroring ftp.gnupg.org still relevant? Best regards, Julian Jørgensen - staff at dotsrc.org From wk at gnupg.org Thu Nov 12 10:58:10 2026 From: wk at gnupg.org (Werner Koch) Date: Thu, 12 Nov 2026 10:58:10 +0100 Subject: gpgsm: How do I import an unprotected key In-Reply-To: ("Ingo =?utf-8?Q?Kl=C3=B6cke?= =?utf-8?Q?r?= via Gnupg-users"'s message of "Tue, 10 Nov 2026 21:35:13 +0100") References: <5c9e3be1-d60d-6910-b75f-141519eca379@wisemo.com> Message-ID: <87zevebcct.fsf@jacob.g10code.de> On Tue, 10 Nov 2026 21:35, Ingo Klöcker said: > $ echo | gpgsm --import --batch --pinentry-mode loopback --passphrase-fd 0 > cert.p12 I just noticed hat we do nothave a passpharse option. I jus implemented that and thus soon you will be abale to do: gpgsm --import --batch --passphrase -- cert.p12 The arg to passphrase will be optional and, like gpg, defaults to the empty string. 4 -- 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: 284 bytes Desc: not available URL: