Skip to content

GPG signing doesn't seem to work with the GPG SQLite DB format #269

@nikclayton

Description

@nikclayton

Version

7.6.0.202603022253-r

Operating System

Windows

Bug description

I use gpg4win on a Windows device, which seems to default to storing GPG keys in the newer SQLite database format in $env:APPDATA/gnupg/public-keys.d/pubring.db.

Trying to commit with a signature throws in

throw new PGPException(MessageFormat.format(
BCText.get().gpgNoPublicKeyFound, signingKey));
because the signing key I have configured in Git can't be found, because jgit+bc can't find the public key.

The very quick and dirty solution I had was to run

gpg-disable-keyboxd
gpg-enable-keyboxd

(those are not gpg sub-commands, they are individual binaries). If I've understood the problem properly disabling keyboxd wrote out a copy of all the keys in the .db file to $env:APPDATA/gnupg/pubring.kbx, which jgit+bc does find when trying to sign a commit.

Actual behavior

No stack trace, just an error message containing the text in gpgNoPublicKeyFound (Unable to find a public-key with key or user id: {0}) and searching the code shows this is the only place where the message text is used.

Expected behavior

jgit+bc should check and see if the use-keyboxd is in common.conf (https://www.gnupg.org/documentation/manuals/gnupg/GPG-Configuration.html), and if it is it should query keyboxd (no idea how, sorry) for the keys, instead of rummaging around in the filesystem itself.

Relevant log output

Other information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions