@Component(role=SignTool.class, hint="default") public class DefaultSignTool extends org.codehaus.plexus.logging.AbstractLogEnabled implements SignTool
SignTool
.Constructor and Description |
---|
DefaultSignTool() |
Modifier and Type | Method and Description |
---|---|
void |
deleteKeyStore(File keystore,
boolean verbose)
Delete an existing key store
|
void |
generateKey(SignConfig config,
File keystoreFile)
Generate a key store using keytool.
|
File |
getKeyStoreFile(String keystore,
File workingKeystore,
ClassLoader classLoader)
Obtain the location of the given keystore.
|
boolean |
isJarSigned(File jarFile)
Tests if the given jar is signed.
|
void |
sign(SignConfig config,
File jarFile,
File signedJar)
Sign a jar using jarsigner.
|
void |
unsign(File jarFile,
boolean verbose)
Unsign a jar.
|
protected void |
verboseLog(boolean verbose,
String msg)
Log as info when verbose or info is enabled, as debug otherwise.
|
void |
verify(SignConfig config,
File jarFile,
boolean certs)
Verify a jar file using jarsigner.
|
@Requirement protected IOUtil ioUtil
public void generateKey(SignConfig config, File keystoreFile) throws org.apache.maven.plugin.MojoExecutionException
generateKey
in interface SignTool
config
- sign configurationkeystoreFile
- location of the keystore to generateorg.apache.maven.plugin.MojoExecutionException
- if something wrong occurspublic void sign(SignConfig config, File jarFile, File signedJar) throws org.apache.maven.plugin.MojoExecutionException
sign
in interface SignTool
config
- sign configurationjarFile
- location of the jar to signsignedJar
- optional location of the signed jar to produce (if not set, will use the original location)org.apache.maven.plugin.MojoExecutionException
- if something wrong occurspublic void verify(SignConfig config, File jarFile, boolean certs) throws org.apache.maven.plugin.MojoExecutionException
public boolean isJarSigned(File jarFile) throws org.apache.maven.plugin.MojoExecutionException
isJarSigned
in interface SignTool
jarFile
- the jar file to testtrue
if jar file is signed, false
otherwiseorg.apache.maven.plugin.MojoExecutionException
- if something wrong occurspublic void unsign(File jarFile, boolean verbose) throws org.apache.maven.plugin.MojoExecutionException
public void deleteKeyStore(File keystore, boolean verbose)
deleteKeyStore
in interface SignTool
keystore
- the keystore to deleteverbose
- flag to display verbose logspublic File getKeyStoreFile(String keystore, File workingKeystore, ClassLoader classLoader) throws org.apache.maven.plugin.MojoExecutionException
getKeyStoreFile
in interface SignTool
keystore
- keystore location to findworkingKeystore
- location where to copy keystore if coming from an url or from classpathclassLoader
- classloader where to find keystore in classpathnull
if could not
locate keystore.org.apache.maven.plugin.MojoExecutionException
- if something wrong occursprotected void verboseLog(boolean verbose, String msg)
verbose
- verbose levelmsg
- message to logCopyright © 2005–2016 MojoHaus. All rights reserved.