Package org.eclipse.jgit.lib
Interface GpgSignatureVerifier
-
- All Known Implementing Classes:
BouncyCastleGpgSignatureVerifier
public interface GpgSignatureVerifier
AGpgVerifier
can verify GPG signatures on git commits and tags.- Since:
- 5.11
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
GpgSignatureVerifier.SignatureVerification
ASignatureVerification
returns data about a (positively or negatively) verified signature.static class
GpgSignatureVerifier.TrustLevel
The owner's trust in a public key.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
clear()
AGpgSignatureVerifier
may cache public keys to speed up verifying signatures on multiple objects.String
getName()
Retrieves the name of this verifier.GpgSignatureVerifier.SignatureVerification
verify(byte[] data, byte[] signatureData)
Verifies a given signature for given data.GpgSignatureVerifier.SignatureVerification
verifySignature(RevObject object, GpgConfig config)
Verifies the signature on a signed commit or tag.
-
-
-
Method Detail
-
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
@NonNull String 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.
-
-