Package org.eclipse.jgit.lib
Interface GpgSignatureVerifier
- All Known Implementing Classes:
BouncyCastleGpgSignatureVerifier
public interface GpgSignatureVerifier
A
GpgVerifier
can verify GPG signatures on git commits and tags.- Since:
- 5.11
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interface
ASignatureVerification
returns data about a (positively or negatively) verified signature.static enum
The owner's trust in a public key. -
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
AGpgSignatureVerifier
may cache public keys to speed up verifying signatures on multiple objects.getName()
Retrieves the name of this verifier.verify
(byte[] data, byte[] signatureData) Verifies a given signature for given data.verifySignature
(RevObject object, GpgConfig config) Verifies the signature on a signed commit or tag.
-
Method Details
-
verifySignature
@Nullable GpgSignatureVerifier.SignatureVerification verifySignature(@NonNull RevObject object, @NonNull GpgConfig config) throws IOException Verifies the signature on a signed commit or tag.- Parameters:
object
- to verifyconfig
- theGpgConfig
to use- Returns:
- a
GpgSignatureVerifier.SignatureVerification
describing the outcome of the verification, ornull
if the object was not signed - Throws:
IOException
- if an error occurs getting a public keyJGitInternalException
- if signature verification fails
-
verify
GpgSignatureVerifier.SignatureVerification verify(byte[] data, byte[] signatureData) throws IOException Verifies a given signature for given data.- Parameters:
data
- the signature is forsignatureData
- the ASCII-armored signature- Returns:
- a
GpgSignatureVerifier.SignatureVerification
describing the outcome - Throws:
IOException
- if the signature cannot be parsedJGitInternalException
- if signature verification fails
-
getName
Retrieves the name of this verifier. This should be a short string identifying the engine that verified the signature, like "gpg" if GPG is used, or "bc" for a BouncyCastle implementation.- Returns:
- the name
-
clear
void clear()AGpgSignatureVerifier
may cache public keys to speed up verifying signatures on multiple objects. This clears this cache, if any.
-