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
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    canLocateSigningKey(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.
    void
    sign(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

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 proper GpgSignature. The generated signature must be set on the specified commit (see ObjectBuilder.setGpgSignature(GpgSignature)).

      Any existing signature on the commit must be discarded prior obtaining the payload via CommitBuilder.build().

      Specified by:
      sign in class org.eclipse.jgit.lib.GpgSigner
      Parameters:
      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)
      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:
      canLocateSigningKey in class org.eclipse.jgit.lib.GpgSigner
      Parameters:
      gpgSigningKey - the signing key to locate (passed as is to the GPG signing tool as is; e.g., 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)
      Returns:
      true if a signing key is available, false otherwise
      Throws:
      org.eclipse.jgit.api.errors.CanceledException - when signing was canceled (eg., user aborted when entering passphrase)