~ubuntu-branches/ubuntu/natty/icedtea-web/natty-proposed

« back to all changes in this revision

Viewing changes to netx/net/sourceforge/jnlp/tools/JarSigner.java

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2010-11-24 13:23:28 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20101124132328-2xb9z39vxga63vr9
Tags: 1.0~20101124-0ubuntu1
* Update to hg 20101124.
* Fix xulrunner dependencies for natty.
* Build-depend on pkg-config and libgtk2.0-dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
 
26
26
package net.sourceforge.jnlp.tools;
27
27
 
 
28
import static net.sourceforge.jnlp.runtime.Translator.R;
 
29
 
28
30
import java.io.*;
29
31
import java.util.*;
30
32
import java.util.zip.*;
40
42
 
41
43
import net.sourceforge.jnlp.*;
42
44
import net.sourceforge.jnlp.cache.*;
43
 
import net.sourceforge.jnlp.runtime.*;
44
45
import net.sourceforge.jnlp.security.*;
45
46
 
46
47
/**
52
53
 
53
54
public class JarSigner implements CertVerifier {
54
55
 
55
 
    private static String R(String key) {
56
 
        return JNLPRuntime.getMessage(key);
57
 
    }
58
 
 
59
56
    private static final Collator collator = Collator.getInstance();
60
57
    static {
61
58
        // this is for case insensitive string comparisions
204
201
        certs = new ArrayList<CertPath>();
205
202
        for (int i = 0; i < jars.size(); i++) {
206
203
 
207
 
            JARDesc jar = (JARDesc) jars.get(i);
 
204
            JARDesc jar = jars.get(i);
208
205
            verifiedJars = new ArrayList<String>();
209
206
            unverifiedJars = new ArrayList<String>();
210
207
 
374
371
    private void checkTrustedCerts() throws Exception {
375
372
        if (certPath != null) {
376
373
                try {
377
 
                        KeyTool kt = new KeyTool();
378
 
                        alreadyTrustPublisher = kt.isTrusted(getPublisher());
379
 
                                rootInCacerts = kt.checkCacertsForCertificate(getRoot());
 
374
                        X509Certificate publisher = (X509Certificate) getPublisher();
 
375
                        KeyStore[] certKeyStores = KeyStores.getCertKeyStores();
 
376
                        alreadyTrustPublisher = CertificateUtils.inKeyStores(publisher, certKeyStores);
 
377
                        X509Certificate root = (X509Certificate) getRoot();
 
378
                        KeyStore[] caKeyStores = KeyStores.getCAKeyStores();
 
379
                        rootInCacerts = CertificateUtils.inKeyStores(root, caKeyStores);
380
380
                } catch (Exception e) {
381
381
                        // TODO: Warn user about not being able to
382
382
                        // look through their cacerts/trusted.certs