Class AbstractGpgSigner

java.lang.Object
org.apache.maven.plugins.gpg.AbstractGpgSigner
Direct Known Subclasses:
BcSigner, GpgSigner

public abstract class AbstractGpgSigner extends Object
A base class for all classes that implements signing of files.
Since:
1.5
Author:
Dennis Lundberg
  • Field Details

    • SIGNATURE_EXTENSION

      public static final String SIGNATURE_EXTENSION
      See Also:
    • useAgent

      protected boolean useAgent
    • isInteractive

      protected boolean isInteractive
    • defaultKeyring

      protected boolean defaultKeyring
    • keyname

      protected String keyname
    • passphrase

      protected String passphrase
    • terminatePassphrase

      protected boolean terminatePassphrase
    • homeDir

      protected File homeDir
    • secretKeyring

      protected String secretKeyring
    • publicKeyring

      protected String publicKeyring
    • lockMode

      protected String lockMode
    • args

      protected List<String> args
  • Constructor Details

    • AbstractGpgSigner

      public AbstractGpgSigner()
  • Method Details

    • getLog

      public org.apache.maven.plugin.logging.Log getLog()
    • setArgs

      public void setArgs(List<String> args)
    • setInteractive

      public void setInteractive(boolean b)
    • setLockMode

      public void setLockMode(String lockMode)
    • setUseAgent

      public void setUseAgent(boolean b)
    • setDefaultKeyring

      public void setDefaultKeyring(boolean enabled)
    • setKeyName

      public void setKeyName(String s)
    • setLog

      public void setLog(org.apache.maven.plugin.logging.Log log)
    • setPassPhrase

      public void setPassPhrase(String s)
    • setTerminatePassphrase

      public void setTerminatePassphrase(boolean b)
    • setOutputDirectory

      public void setOutputDirectory(File out)
    • setBuildDirectory

      public void setBuildDirectory(File out)
    • setBaseDirectory

      public void setBaseDirectory(File out)
    • setHomeDirectory

      public void setHomeDirectory(File homeDirectory)
    • setSecretKeyring

      public void setSecretKeyring(String path)
    • setPublicKeyring

      public void setPublicKeyring(String path)
    • signerName

      public abstract String signerName()
    • prepare

      public void prepare() throws org.apache.maven.plugin.MojoFailureException
      Must be invoked BEFORE signing!
      Throws:
      org.apache.maven.plugin.MojoFailureException
      Since:
      3.2.0
    • getKeyInfo

      public abstract String getKeyInfo()
      Should return some identification about the used key for logging purposes. Can be invoked only AFTER prepare() was invoked.
      Since:
      3.2.2
    • generateSignatureForArtifact

      public File generateSignatureForArtifact(File file) throws org.apache.maven.plugin.MojoExecutionException
      Create a detached signature file for the provided file. Can be invoked only AFTER prepare() was invoked.
      Parameters:
      file - The file to sign
      Returns:
      A reference to the generated signature file
      Throws:
      org.apache.maven.plugin.MojoExecutionException - if signature generation fails
    • generateSignatureForFile

      protected abstract void generateSignatureForFile(File file, File signature) throws org.apache.maven.plugin.MojoExecutionException
      Generate the detached signature file for the provided file.
      Parameters:
      file - The file to sign
      signature - The file in which the generate signature will be put
      Throws:
      org.apache.maven.plugin.MojoExecutionException - if signature generation fails