Allow encryption/signing in GPGME using a specified subkey
Closed, ResolvedPublic

Assigned To
Authored By
• werner
Aug 2 2017, 11:43 AM

Description

There is currently no way to encorce signing/encryption to a subkey in GPGME in the same way we allow
it with the '!' suffix on the CLI.

This can be implemented by allowing to set a selected flag in the gpgme_subkey_t. engine-gpg.c could then scan the subkeys for such a flag and use that fingerprint with the '!' suffix.

Related Objects

Event Timeline

marcus moved this task from QA for next release to Backlog on the gpgme board.
• werner claimed this task.

With the recpstring feature in 1.11 this is now possible because the args are passed verbatim to gpg.

@werner Looks like recpstring is only supported for encrypt and encrypt+sign, but not just for signing. Is there a way to specify the subkey to use when signing?

Please see the section 'Selecting Signers'.

@werner This one? https://www.gnupg.org/documentation/manuals/gpgme/Selecting-Signers.html

It doesn't mention subkeys. Signing just seems to use a "default" subkey.

Attached is a patch which adds gpgme_subkey_set_flag() to handle both encryption and signing keys. Or maybe it would be better to add another signing function that does recpstring?

• werner changed the task status from Open to Testing.May 5 2025, 4:46 PM
• werner moved this task from Backlog to QA for next release on the gpgme board.