public class JarTools extends Object
THIS CLASS IS INTENDED FOR WINDOWS!
Constructor and Description |
---|
JarTools() |
Modifier and Type | Method and Description |
---|---|
static boolean |
configureJarSigning(VirtualSessionManager vsm,
IniFile ini)
Called to edit the dialog box for Jar Signing.
|
static X509Certificate[] |
getJarCertificates(JarFile jf)
Verifies an open JAR file (with verify flag present) for
valid certificates.
|
static void |
initalizeSigningData(IniFile ini)
Initializes an INI file with default settings for signing for new projects.
|
static boolean |
isJarSigned(String jarFileName)
Checks if a JAR file is signed.
|
static void |
putAttributes(Attributes attributes)
Puts the version, trusted, sealed, permission and codebase attributes into the manifest.
|
static String |
removeJarSignature(String jarFileName)
Removes the existing signature in a JAR file.
|
static String |
removeJarsSignature(VirtualPanel vp,
String parent,
String files)
Removes all signatures from the specified JAR files, ignoring ZIP files.
|
static boolean |
repack200Jar(String fn,
IniFile ini)
Deprecated.
"for-removal" since Java 14 with no replacement.
|
static int |
signJar(String fn,
IniFile ini)
Signs a single file with the INI file settings.
|
static String |
signJars(VirtualPanel vp,
String parent,
String files,
IniFile ini)
Signs the specified JAR files, ignoring ZIP files.
|
static void |
transferSigningData(IniFile from,
IniFile to)
Transfers the INI settings for signing from one INI file to another.
|
static String |
verifyManifest(Manifest man)
Verifies that the main manifest attributes are correct according to Java 7 update 25 or better
using the update security model for sealed, codebase and permissions attributes.
|
static String |
verifyManifest(String fn)
Verifies that the main manifest attributes are correct according to Java 7 update 25 or better
using the update security model for sealed, codebase and permissions attributes.
|
public static String verifyManifest(String fn) throws IOException
fn
- The Jar file name.IOException
public static String verifyManifest(Manifest man)
man
- The manifest.public static void putAttributes(Attributes attributes)
public static X509Certificate[] getJarCertificates(JarFile jf) throws IOException
IOException
- if there is a problem with the JAR file or it's signing.public static boolean isJarSigned(String jarFileName)
public static String removeJarSignature(String jarFileName)
public static boolean configureJarSigning(VirtualSessionManager vsm, IniFile ini)
public static void transferSigningData(IniFile from, IniFile to)
public static void initalizeSigningData(IniFile ini)
public static String removeJarsSignature(VirtualPanel vp, String parent, String files)
public static int signJar(String fn, IniFile ini) throws IOException
IOException
- for file failures.public static String signJars(VirtualPanel vp, String parent, String files, IniFile ini)
@Deprecated public static boolean repack200Jar(String fn, IniFile ini) throws IOException
Since Java 14, this has been removed due to:
Pack200 modifies the contents of the Java class files in the JAR archive undergoing compression.
Transformations to the class files include merging constant pools and removing duplicated attributes.
The format is not lossless; it is possible for a JAR file after unpacking to not be identical to how
it was before packing.
The "client.jars.pack200" setting in [Base] section in the project is therefore ignored.
IOException
- for file failures.Phantom® and NetPhantom® are registered trademarks of Mindus SARL.
© © Mindus SARL, 2024. All rights reserved.