public class VerifySignatureCommand extends GitCommand<Map<String,VerificationResult>>
Modifier and Type | Class and Description |
---|---|
static class |
VerifySignatureCommand.VerifyMode
Describes what kind of objects shall be handled by a
VerifySignatureCommand . |
repo
Constructor and Description |
---|
VerifySignatureCommand(Repository repo)
Creates a new
VerifySignatureCommand for the given Repository . |
Modifier and Type | Method and Description |
---|---|
VerifySignatureCommand |
addName(String name)
Add a name of an object (SHA-1, ref name; anything that can be
resolved ) to the command to have its
signature verified. |
VerifySignatureCommand |
addNames(Collection<String> names)
Add names of objects (SHA-1, ref name; anything that can be
resolved ) to the command to have their
signatures verified. |
VerifySignatureCommand |
addNames(String... names)
Add names of objects (SHA-1, ref name; anything that can be
resolved ) to the command to have their
signatures verified. |
Map<String,VerificationResult> |
call()
Resolves all names added to the
command to git objects and verifies their signature. |
GpgSignatureVerifier |
getVerifier()
Retrieves the currently set
GpgSignatureVerifier . |
VerifySignatureCommand |
setGpgConfig(GpgConfig config)
Sets an external
GpgConfig to use. |
VerifySignatureCommand |
setMode(VerifySignatureCommand.VerifyMode mode)
Sets the mode of operation for this command.
|
VerifySignatureCommand |
setVerifier(GpgSignatureVerifier verifier)
Sets the
GpgSignatureVerifier to use. |
checkCallable, getRepository, setCallable
public VerifySignatureCommand(Repository repo)
VerifySignatureCommand
for the given Repository
.repo
- to operate onpublic VerifySignatureCommand addName(String name)
resolved
) to the command to have its
signature verified.name
- to addthis
public VerifySignatureCommand addNames(String... names)
resolved
) to the command to have their
signatures verified.names
- to add; duplicates will be ignoredthis
public VerifySignatureCommand addNames(Collection<String> names)
resolved
) to the command to have their
signatures verified.names
- to add; duplicates will be ignoredthis
public VerifySignatureCommand setMode(@NonNull VerifySignatureCommand.VerifyMode mode)
mode
- the VerifySignatureCommand.VerifyMode
to setthis
public VerifySignatureCommand setVerifier(GpgSignatureVerifier verifier)
GpgSignatureVerifier
to use.verifier
- the GpgSignatureVerifier
to use, or null
to
use the default verifierthis
public VerifySignatureCommand setGpgConfig(GpgConfig config)
GpgConfig
to use. Whether it will be used it at
the discretion of the setVerifier(GpgSignatureVerifier)
.config
- to set; if null
, the config will be loaded from the
git config of the repositorythis
public GpgSignatureVerifier getVerifier()
GpgSignatureVerifier
. Can be used
after a successful call()
to get the verifier that was used.GpgSignatureVerifier
@NonNull public Map<String,VerificationResult> call() throws ServiceUnavailableException, WrongObjectTypeException
Resolves
all names added to the
command to git objects and verifies their signature. Non-existing objects
are ignored.
Depending on the setMode(VerifyMode)
, only tags or commits or
any kind of objects are allowed.
Unsigned objects are silently skipped.
call
in interface Callable<Map<String,VerificationResult>>
call
in class GitCommand<Map<String,VerificationResult>>
VerificationResult
, excluding ignored or skipped objects.ServiceUnavailableException
- if no GpgSignatureVerifier
was set and no
GpgSignatureVerifierFactory
is availableWrongObjectTypeException
- if a name resolves to an object of a type not allowed by the
setMode(VerifyMode)
modeCopyright © 2021 Eclipse JGit Project. All rights reserved.