jgit/org.eclipse.jgit.pgm
Thomas Wolf 3774fcc848 GPG signature verification via BouncyCastle
Add a GpgSignatureVerifier interface, plus a factory to create
instances thereof that is provided via the ServiceLoader mechanism.

Implement the new interface for BouncyCastle. A verifier maintains
an internal LRU cache of previously found public keys to speed up
verifying multiple objects (tag or commits). Mergetags are not handled.

Provide a new VerifySignatureCommand in org.eclipse.jgit.api together
with a factory method Git.verifySignature(). The command can verify
signatures on tags or commits, and can be limited to accept only tags
or commits. Provide a new public WrongObjectTypeException thrown when
the command is limited to either tags or commits and a name resolves
to some other object kind.

In jgit.pgm, implement "git tag -v", "git log --show-signature", and
"git show --show-signature". The output is similar to command-line
gpg invoked via git, but not identical. In particular, lines are not
prefixed by "gpg:" but by "bc:".

Trust levels for public keys are read from the keys' trust packets,
not from GPG's internal trust database. A trust packet may or may
not be set. Command-line GPG produces more warning lines depending
on the trust level, warning about keys with a trust level below
"full".

There are no unit tests because JGit still doesn't have any setup to
do signing unit tests; this would require at least a faked .gpg
directory with pre-created key rings and keys, and a way to make the
BouncyCastle classes use that directory instead of the default. See
bug 547538 and also bug 544847.

Tested manually with a small test repository containing signed and
unsigned commits and tags, with signatures made with different keys
and made by command-line git using GPG 2.2.25 and by JGit using
BouncyCastle 1.65.

Bug: 547751
Change-Id: If7e34aeed6ca6636a92bf774d893d98f6d459181
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2021-02-16 00:37:00 +01:00
..
.settings Enable and fix "Statement unnecessarily nested within else clause" warnings 2019-10-17 10:20:14 +09:00
META-INF pgm: add missing dependency to org.apache.commons.logging 2021-01-17 18:04:38 -05:00
resources GPG signature verification via BouncyCastle 2021-02-16 00:37:00 +01:00
src/org/eclipse/jgit GPG signature verification via BouncyCastle 2021-02-16 00:37:00 +01:00
.classpath Change JGit minimum execution environment to JavaSE-1.8 2016-09-20 11:32:36 +02:00
.gitignore Finish removing Apache Felix maven-bundle-plugin 2010-01-12 11:46:55 -08:00
.project Enforce the use of Java5 API:s only (with a few exceptions) 2011-12-16 01:01:36 +01:00
BUILD Decouple JSch from JGit Core 2020-06-01 01:46:59 +02:00
about.html Add missing about.html files to all shipped bundles 2011-06-08 21:51:51 +02:00
build.properties Do not include log4j implementation in jgit 2020-06-01 01:56:33 +02:00
jgit.sh Enable passing java options to jgit command line executable 2020-04-28 13:57:42 +02:00
plugin.properties Fix bundle localization of Apache SSH bundle 2019-06-21 17:54:06 +02:00
pom.xml Prepare 5.11.0-SNAPSHOT builds 2020-12-02 15:57:16 +01:00