Package org.omegat.core.team2.impl
Class GITExternalGpgSigner
java.lang.Object
org.eclipse.jgit.lib.GpgSigner
org.omegat.core.team2.impl.GITExternalGpgSigner
public class GITExternalGpgSigner
extends org.eclipse.jgit.lib.GpgSigner
This is ported from EGit (Apache-2.0).
The class will be deprecated in the future. JGit 7.x and later
supports GPG signing natively.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancanLocateSigningKey(String gpgSigningKey, org.eclipse.jgit.lib.PersonIdent committer, org.eclipse.jgit.transport.CredentialsProvider credentialsProvider) Indicates if a signing key is available for the specified committer and/or signing key.voidsign(org.eclipse.jgit.lib.CommitBuilder commit, String gpgSigningKey, org.eclipse.jgit.lib.PersonIdent committer, org.eclipse.jgit.transport.CredentialsProvider credentialsProvider) Signs the specified commit.Methods inherited from class org.eclipse.jgit.lib.GpgSigner
getDefault, setDefault
-
Constructor Details
-
GITExternalGpgSigner
public GITExternalGpgSigner()
-
-
Method Details
-
sign
public void sign(org.eclipse.jgit.lib.CommitBuilder commit, String gpgSigningKey, org.eclipse.jgit.lib.PersonIdent committer, org.eclipse.jgit.transport.CredentialsProvider credentialsProvider) throws org.eclipse.jgit.api.errors.CanceledException Signs the specified commit.Implementors should obtain the payload for signing from the specified commit via
CommitBuilder.build()and create a properGpgSignature. The generated signature must be set on the specifiedcommit(seeObjectBuilder.setGpgSignature(GpgSignature)).Any existing signature on the commit must be discarded prior obtaining the payload via
CommitBuilder.build().- Specified by:
signin classorg.eclipse.jgit.lib.GpgSigner- Parameters:
commit- the commit to sign (must not benulland 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 ofuser.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)- Throws:
org.eclipse.jgit.api.errors.CanceledException- when signing was canceled (eg., user aborted when entering passphrase)
-
canLocateSigningKey
public boolean canLocateSigningKey(String gpgSigningKey, org.eclipse.jgit.lib.PersonIdent committer, org.eclipse.jgit.transport.CredentialsProvider credentialsProvider) throws org.eclipse.jgit.api.errors.CanceledException Indicates if a signing key is available for the specified committer and/or signing key.- Specified by:
canLocateSigningKeyin classorg.eclipse.jgit.lib.GpgSigner- Parameters:
gpgSigningKey- the signing key to locate (passed as is to the GPG signing tool as is; e.g., value ofuser.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)- Returns:
trueif a signing key is available,falseotherwise- Throws:
org.eclipse.jgit.api.errors.CanceledException- when signing was canceled (eg., user aborted when entering passphrase)
-