public class JarSignerUtil extends Object
Modifier and Type | Method and Description |
---|---|
protected static Manifest |
buildUnsignedManifest(Manifest manifest)
Build a new manifest from the given one, removing any signing information inside it.
|
static boolean |
isArchiveSigned(File jarFile)
Scans an archive for existing signatures.
|
protected static boolean |
isManifestFile(String entryName) |
protected static boolean |
isSignatureFile(String entryName)
Checks whether the specified JAR file entry denotes a signature-related file, i.e.
|
static boolean |
isZipFile(File file)
Checks whether the specified file is a JAR file.
|
static void |
unsignArchive(File jarFile)
Removes any existing signatures from the specified JAR file.
|
public static boolean isZipFile(File file)
file
- The file to check, must not be null
.true
if the file looks like a ZIP file, false
otherwise.public static void unsignArchive(File jarFile) throws IOException
jarFile
- The JAR file to unsign, must not be null
.IOException
protected static Manifest buildUnsignedManifest(Manifest manifest)
manifest
- manifest to cleanpublic static boolean isArchiveSigned(File jarFile) throws IOException
jarFile
- The archive to scan, must not be null
.true
, if the archive contains at least one signature file; false
, if the archive
does not contain any signature files.IOException
- if scanning jarFile
fails.protected static boolean isSignatureFile(String entryName)
META-INF/*.SF
, META-INF/*.DSA
, META-INF/*.RSA
or
META-INF/*.EC
.entryName
- The name of the JAR file entry to check, must not be null
.true
if the entry is related to a signature, false
otherwise.protected static boolean isManifestFile(String entryName)
Copyright © 2002-2014 The Apache Software Foundation. All Rights Reserved.