org.codehaus.mojo.webstart.sign
Interface SignTool

All Known Implementing Classes:
DefaultSignTool

public interface SignTool

Tool api for jarsigner operations.

Since:
1.0-beta-3
Author:
tchemit

Field Summary
static String ROLE
          Plexus component role.
 
Method Summary
 void deleteKeyStore(File keystore, boolean verbose)
          Delete an existing key store
 void generateKey(SignConfig config, File keystoreFile)
          Generate a key store using keytool.
 boolean isJarSigned(SignConfig config, 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, File tempDirectory, boolean verbose)
          Unsign a jar.
 void verify(SignConfig config, File jarFile, boolean certs)
          Verify a jar file using jarsigner.
 

Field Detail

ROLE

static final String ROLE
Plexus component role.

Method Detail

generateKey

void generateKey(SignConfig config,
                 File keystoreFile)
                 throws org.apache.maven.plugin.MojoExecutionException
Generate a key store using keytool.

Parameters:
config - sign configuration
keystoreFile - location of the keystore to generate
Throws:
org.apache.maven.plugin.MojoExecutionException - if something wrong occurs

sign

void sign(SignConfig config,
          File jarFile,
          File signedJar)
          throws org.apache.maven.plugin.MojoExecutionException
Sign a jar using jarsigner.

Parameters:
config - sign configuration
jarFile - location of the jar to sign
signedJar - optional location of the signed jar to produce (if not set, will use the original location)
Throws:
org.apache.maven.plugin.MojoExecutionException - if something wrong occurs

verify

void verify(SignConfig config,
            File jarFile,
            boolean certs)
            throws org.apache.maven.plugin.MojoExecutionException
Verify a jar file using jarsigner.

Parameters:
config - sign configuration
jarFile - location of the jar to sign
certs - flag to show certificats details
Throws:
org.apache.maven.plugin.MojoExecutionException - if something wrong occurs

isJarSigned

boolean isJarSigned(SignConfig config,
                    File jarFile)
                    throws org.apache.maven.plugin.MojoExecutionException
Tests if the given jar is signed.

Parameters:
config - sign configuration
jarFile - the jar file to test
Returns:
true if jar file is signed, false otherwise
Throws:
org.apache.maven.plugin.MojoExecutionException - if something wrong occurs

unsign

void unsign(File jarFile,
            File tempDirectory,
            boolean verbose)
            throws org.apache.maven.plugin.MojoExecutionException
Unsign a jar.

Parameters:
jarFile - location of the jar to unsign
tempDirectory - temp directory where to unzip the jar
verbose - flag to display verbose logs
Throws:
org.apache.maven.plugin.MojoExecutionException - if something wrong occurs

deleteKeyStore

void deleteKeyStore(File keystore,
                    boolean verbose)
Delete an existing key store

Parameters:
keystore - the keystore to delete
verbose - flag to display verbose logs


Copyright © 2005-2012 Codehaus. All Rights Reserved.