public abstract class GpgSigner extends Object
| Constructor and Description |
|---|
GpgSigner() |
| Modifier and Type | Method and Description |
|---|---|
abstract boolean |
canLocateSigningKey(String gpgSigningKey,
PersonIdent committer,
CredentialsProvider credentialsProvider)
Indicates if a signing key is available for the specified committer
and/or signing key.
|
static GpgSigner |
getDefault()
Get the default signer, or
null. |
static void |
setDefault(GpgSigner signer)
Set the default signer.
|
abstract void |
sign(CommitBuilder commit,
String gpgSigningKey,
PersonIdent committer,
CredentialsProvider credentialsProvider)
Signs the specified commit.
|
public static GpgSigner getDefault()
null.null.public static void setDefault(GpgSigner signer)
signer - the new default signer, may be null to select no
default.public abstract void sign(@NonNull CommitBuilder commit, @Nullable String gpgSigningKey, @NonNull PersonIdent committer, CredentialsProvider credentialsProvider) throws CanceledException
Implementors should obtain the payload for signing from the specified
commit via CommitBuilder.build() and create a proper
GpgSignature. The generated signature must be set on the
specified commit (see
CommitBuilder.setGpgSignature(GpgSignature)).
Any existing signature on the commit must be discarded prior obtaining
the payload via CommitBuilder.build().
commit - the commit to sign (must not be null and must be
complete to allow proper calculation of payload)gpgSigningKey - the signing key to locate (passed as is to the GPG signing
tool as is; eg., value of user.signingkey)committer - the signing identity (to help with key lookup in case signing
key is not specified)credentialsProvider - provider to use when querying for signing key credentials (eg.
passphrase)CanceledException - when signing was canceled (eg., user aborted when entering
passphrase)public abstract boolean canLocateSigningKey(@Nullable String gpgSigningKey, @NonNull PersonIdent committer, CredentialsProvider credentialsProvider) throws CanceledException
gpgSigningKey - the signing key to locate (passed as is to the GPG signing
tool as is; eg., value of user.signingkey)committer - the signing identity (to help with key lookup in case signing
key is not specified)credentialsProvider - provider to use when querying for signing key credentials (eg.
passphrase)true if a signing key is available,
false otherwiseCanceledException - when signing was canceled (eg., user aborted when entering
passphrase)Copyright © 2020 Eclipse JGit Project. All rights reserved.