Package com.iizix.security
Class JarSigner
java.lang.Object
com.iizix.security.JarSigner
Helper class to sign a Jar file.
- Author:
- Christopher Mindus
Method Summary
Method Details
getJarsigner
Gets the jarsigner executable that is present in the JDK.- Returns:
- The jarsigner executable.
- Throws:
NotFoundException- If jarsigner[.exe] is not found.
signJar
public static void signJar(File jarFile, KeyStore keystore, File keystoreFile, String storetype, String storePassword, String keyPassword, String alias, String tsa) throws IOException Signs the Jar file.Note: if
tsaparameter is set, i.e. timestamping is used, an Internet connection must be present, otherwise this call will fail.- Parameters:
jarFile- The Jar file to sign.keystore- The keystore, or null for keystore from a file.keystoreFile- The keystore file must be specified ifkeystoreparameter is null.storetype- The keystore type, e.g. JKS or PKCS12.storePassword- The password for the keystore.keyPassword- The password for the private key, if different thanstorePassword, null otherwise.alias- The alias to use.tsa- The timestamping authority URL, null for none.- Throws:
IOException- For I/O errors.