- All Known Implementing Classes:
AbstractGpgSignatureVerifier
public interface GpgSignatureVerifier
A
GpgSignatureVerifier can verify GPG signatures on git commits and
tags.- Since:
- 5.11
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceASignatureVerificationreturns data about a (positively or negatively) verified signature.static enumThe owner's trust in a public key. -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()AGpgSignatureVerifiermay cache public keys to speed up verifying signatures on multiple objects.getName()Retrieves the name of this verifier.verify(byte[] data, byte[] signatureData) Deprecated.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- theGpgConfigto use- Returns:
- a
GpgSignatureVerifier.SignatureVerificationdescribing the outcome of the verification, ornullif the object was not signed - Throws:
IOException- if an error occurs getting a public keyJGitInternalException- if signature verification fails
-
verify
default GpgSignatureVerifier.SignatureVerification verify(@NonNull GpgConfig config, byte[] data, byte[] signatureData) throws IOException Verifies a given signature for given data.- Parameters:
config- theGpgConfigdata- the signature is forsignatureData- the ASCII-armored signature- Returns:
- a
GpgSignatureVerifier.SignatureVerificationdescribing the outcome - Throws:
IOException- if the signature cannot be parsedJGitInternalException- if signature verification fails- Since:
- 6.9
-
verify
@Deprecated GpgSignatureVerifier.SignatureVerification verify(byte[] data, byte[] signatureData) throws IOException Deprecated.since 6.9, useverify(GpgConfig, byte[], byte[])insteadVerifies a given signature for given data.- Parameters:
data- the signature is forsignatureData- the ASCII-armored signature- Returns:
- a
GpgSignatureVerifier.SignatureVerificationdescribing 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()AGpgSignatureVerifiermay cache public keys to speed up verifying signatures on multiple objects. This clears this cache, if any.
-
verify(GpgConfig, byte[], byte[])instead