java.util.jar.JarException Java Examples

The following examples show how to use java.util.jar.JarException. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: SignatureFileVerifier.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * process the signature block file. Goes through the .SF file
 * and adds code signers for each section where the .SF section
 * hash was verified against the Manifest section.
 *
 *
 */
public void process(Hashtable<String, CodeSigner[]> signers,
        List<Object> manifestDigests)
    throws IOException, SignatureException, NoSuchAlgorithmException,
        JarException, CertificateException
{
    // calls Signature.getInstance() and MessageDigest.getInstance()
    // need to use local providers here, see Providers class
    Object obj = null;
    try {
        obj = Providers.startJarVerification();
        processImpl(signers, manifestDigests);
    } finally {
        Providers.stopJarVerification(obj);
    }

}
 
Example #2
Source File: SignatureFileVerifier.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
/**
 * process the signature block file. Goes through the .SF file
 * and adds code signers for each section where the .SF section
 * hash was verified against the Manifest section.
 *
 *
 */
public void process(Hashtable<String, CodeSigner[]> signers,
        List<Object> manifestDigests)
    throws IOException, SignatureException, NoSuchAlgorithmException,
        JarException, CertificateException
{
    // calls Signature.getInstance() and MessageDigest.getInstance()
    // need to use local providers here, see Providers class
    Object obj = null;
    try {
        obj = Providers.startJarVerification();
        processImpl(signers, manifestDigests);
    } finally {
        Providers.stopJarVerification(obj);
    }

}
 
Example #3
Source File: SignatureFileVerifier.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
/**
 * process the signature block file. Goes through the .SF file
 * and adds code signers for each section where the .SF section
 * hash was verified against the Manifest section.
 *
 *
 */
public void process(Hashtable<String, CodeSigner[]> signers,
        List<Object> manifestDigests)
    throws IOException, SignatureException, NoSuchAlgorithmException,
        JarException, CertificateException
{
    // calls Signature.getInstance() and MessageDigest.getInstance()
    // need to use local providers here, see Providers class
    Object obj = null;
    try {
        obj = Providers.startJarVerification();
        processImpl(signers, manifestDigests);
    } finally {
        Providers.stopJarVerification(obj);
    }

}
 
Example #4
Source File: SignatureFileVerifier.java    From Bytecoder with Apache License 2.0 6 votes vote down vote up
/**
 * process the signature block file. Goes through the .SF file
 * and adds code signers for each section where the .SF section
 * hash was verified against the Manifest section.
 *
 *
 */
public void process(Hashtable<String, CodeSigner[]> signers,
        List<Object> manifestDigests)
    throws IOException, SignatureException, NoSuchAlgorithmException,
        JarException, CertificateException
{
    // calls Signature.getInstance() and MessageDigest.getInstance()
    // need to use local providers here, see Providers class
    Object obj = null;
    try {
        obj = Providers.startJarVerification();
        processImpl(signers, manifestDigests);
    } finally {
        Providers.stopJarVerification(obj);
    }

}
 
Example #5
Source File: SignatureFileVerifier.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * process the signature block file. Goes through the .SF file
 * and adds code signers for each section where the .SF section
 * hash was verified against the Manifest section.
 *
 *
 */
public void process(Hashtable<String, CodeSigner[]> signers,
        List<Object> manifestDigests)
    throws IOException, SignatureException, NoSuchAlgorithmException,
        JarException, CertificateException
{
    // calls Signature.getInstance() and MessageDigest.getInstance()
    // need to use local providers here, see Providers class
    Object obj = null;
    try {
        obj = Providers.startJarVerification();
        processImpl(signers, manifestDigests);
    } finally {
        Providers.stopJarVerification(obj);
    }

}
 
Example #6
Source File: SignatureFileVerifier.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * process the signature block file. Goes through the .SF file
 * and adds code signers for each section where the .SF section
 * hash was verified against the Manifest section.
 *
 *
 */
public void process(Hashtable<String, CodeSigner[]> signers,
        List<Object> manifestDigests)
    throws IOException, SignatureException, NoSuchAlgorithmException,
        JarException, CertificateException
{
    // calls Signature.getInstance() and MessageDigest.getInstance()
    // need to use local providers here, see Providers class
    Object obj = null;
    try {
        obj = Providers.startJarVerification();
        processImpl(signers, manifestDigests);
    } finally {
        Providers.stopJarVerification(obj);
    }

}
 
Example #7
Source File: SignatureFileVerifier.java    From jdk8u_jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * process the signature block file. Goes through the .SF file
 * and adds code signers for each section where the .SF section
 * hash was verified against the Manifest section.
 *
 *
 */
public void process(Hashtable<String, CodeSigner[]> signers,
        List<Object> manifestDigests)
    throws IOException, SignatureException, NoSuchAlgorithmException,
        JarException, CertificateException
{
    // calls Signature.getInstance() and MessageDigest.getInstance()
    // need to use local providers here, see Providers class
    Object obj = null;
    try {
        obj = Providers.startJarVerification();
        processImpl(signers, manifestDigests);
    } finally {
        Providers.stopJarVerification(obj);
    }

}
 
Example #8
Source File: SignatureFileVerifier.java    From dragonwell8_jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * process the signature block file. Goes through the .SF file
 * and adds code signers for each section where the .SF section
 * hash was verified against the Manifest section.
 *
 *
 */
public void process(Hashtable<String, CodeSigner[]> signers,
        List<Object> manifestDigests)
    throws IOException, SignatureException, NoSuchAlgorithmException,
        JarException, CertificateException
{
    // calls Signature.getInstance() and MessageDigest.getInstance()
    // need to use local providers here, see Providers class
    Object obj = null;
    try {
        obj = Providers.startJarVerification();
        processImpl(signers, manifestDigests);
    } finally {
        Providers.stopJarVerification(obj);
    }

}
 
Example #9
Source File: OldJarExceptionTest.java    From j2objc with Apache License 2.0 5 votes vote down vote up
/**
 * java.util.jar.JarException#JarException(java.lang.String)
 */
public void test_Constructor() throws Exception {
    JarException ex = new JarException();
    JarException ex1 = new JarException("Test string");
    JarException ex2 = new JarException(null);
    assertNotSame(ex, ex1);
    assertNotSame(ex.getMessage(), ex1.getMessage());
    assertNotSame(ex, ex2);
    assertSame(ex.getMessage(), ex2.getMessage());
}
 
Example #10
Source File: Dropper.java    From JReFrameworker with MIT License 5 votes vote down vote up
private static void modifyTarget(File originalRuntime, String mergeRenamePrefix, File outputRuntime, boolean watermark, byte[]... classFiles) throws JarException, IOException {
	Engine engine = new Engine(originalRuntime, mergeRenamePrefix);
	for(byte[] classFile : classFiles){
		engine.process(classFile);
	}
	if(watermark){
		engine.addFile(WATERMARK, WATERMARK.getBytes(), true);
	}
	engine.save(outputRuntime);
}
 
Example #11
Source File: Dropper.java    From JReFrameworker with MIT License 5 votes vote down vote up
private static void modifyTarget(File originalRuntime, String mergeRenamePrefix, File outputRuntime, boolean watermark, byte[]... classFiles) throws JarException, IOException {
	Engine engine = new Engine(originalRuntime, mergeRenamePrefix);
	for(byte[] classFile : classFiles){
		engine.process(classFile);
	}
	if(watermark){
		engine.addFile(WATERMARK, WATERMARK.getBytes(), true);
	}
	engine.save(outputRuntime);
}
 
Example #12
Source File: OldJarExceptionTest.java    From j2objc with Apache License 2.0 4 votes vote down vote up
public void test_ConstructorLjava_lang_String() throws Exception {
    JarException ex1 = new JarException("Test string");
    JarException ex2 = new JarException(null);
    assertNotSame(ex1, ex2);
    assertNotSame(ex1.getMessage(), ex2.getMessage());
}
 
Example #13
Source File: JarExceptionTest.java    From j2objc with Apache License 2.0 4 votes vote down vote up
/**
 * java.util.jar.JarException#JarException()
 */
public void test_Constructor_void() throws Exception {
    new JarException();
}
 
Example #14
Source File: JarExceptionTest.java    From j2objc with Apache License 2.0 4 votes vote down vote up
/**
 * java.util.jar.JarException#JarException(java.lang.String)
 */
public void test_ConstructorLjava_lang_String1() throws Exception {
    assertEquals("Jar Exception", new JarException("Jar Exception").getMessage());
}
 
Example #15
Source File: Engine.java    From JReFrameworker with MIT License 4 votes vote down vote up
public Engine(File jar, String mergeRenamePrefix, ClassLoader[] classLoaders) throws JarException, IOException {
	this(jar, mergeRenamePrefix);
	this.classLoaders = classLoaders;
}
 
Example #16
Source File: Engine.java    From JReFrameworker with MIT License 4 votes vote down vote up
public Engine(File jar, String mergeRenamePrefix) throws JarException, IOException {
	this.mergeRenamePrefix = mergeRenamePrefix;
	this.jarModifier = new JarModifier(jar);
	this.jarName = jar.getName();
	this.originalEntries = new HashSet<String>(jarModifier.getJarEntrySet());
}
 
Example #17
Source File: Engine.java    From JReFrameworker with MIT License 4 votes vote down vote up
public Engine(File jar, String mergeRenamePrefix, ClassLoader[] classLoaders) throws JarException, IOException {
	this(jar, mergeRenamePrefix);
	this.classLoaders = classLoaders;
}
 
Example #18
Source File: Engine.java    From JReFrameworker with MIT License 4 votes vote down vote up
public Engine(File jar, String mergeRenamePrefix) throws JarException, IOException {
	this.mergeRenamePrefix = mergeRenamePrefix;
	this.jarModifier = new JarModifier(jar);
	this.jarName = jar.getName();
	this.originalEntries = new HashSet<String>(jarModifier.getJarEntrySet());
}