diff options
author | Adam Domurad <[email protected]> | 2012-10-19 14:34:16 -0400 |
---|---|---|
committer | Adam Domurad <[email protected]> | 2012-10-19 14:34:16 -0400 |
commit | eca6b5289555031b31da4721800f5031c87bb309 (patch) | |
tree | 45378524fa07783879a1b21d90538b763538df8a /netx/net/sourceforge/jnlp/security | |
parent | e150560769232e18fa516609933649dab002f358 (diff) |
Use interface types in JCV classes where applicable
Diffstat (limited to 'netx/net/sourceforge/jnlp/security')
3 files changed, 26 insertions, 26 deletions
diff --git a/netx/net/sourceforge/jnlp/security/AppVerifier.java b/netx/net/sourceforge/jnlp/security/AppVerifier.java index 2fc1ec0..95c608f 100644 --- a/netx/net/sourceforge/jnlp/security/AppVerifier.java +++ b/netx/net/sourceforge/jnlp/security/AppVerifier.java @@ -38,7 +38,7 @@ exception statement from your version. package net.sourceforge.jnlp.security; import java.security.cert.CertPath; -import java.util.HashMap; +import java.util.Map; import net.sourceforge.jnlp.JNLPFile; import net.sourceforge.jnlp.LaunchException; @@ -58,8 +58,8 @@ public interface AppVerifier { * @return True if the app trusts its publishers. */ public boolean hasAlreadyTrustedPublisher( - HashMap<CertPath, CertInformation> certs, - HashMap<String, Integer> signedJars); + Map<CertPath, CertInformation> certs, + Map<String, Integer> signedJars); /** * Checks if the app has signer(s) whose certs along their chains are in CA certs. @@ -68,8 +68,8 @@ public interface AppVerifier { * signed entries each one has. * @return True if the app has a root in the CA certs store. */ - public boolean hasRootInCacerts(HashMap<CertPath, CertInformation> certs, - HashMap<String, Integer> signedJars); + public boolean hasRootInCacerts(Map<CertPath, CertInformation> certs, + Map<String, Integer> signedJars); /** * Checks if the app's jars are covered by the provided certificates, enough @@ -79,8 +79,8 @@ public interface AppVerifier { * signed entries each one has. * @return */ - public boolean isFullySigned(HashMap<CertPath, CertInformation> certs, - HashMap<String, Integer> signedJars); + public boolean isFullySigned(Map<CertPath, CertInformation> certs, + Map<String, Integer> signedJars); /** * Prompt the user with requests for trusting the certificates used by this app diff --git a/netx/net/sourceforge/jnlp/security/JNLPAppVerifier.java b/netx/net/sourceforge/jnlp/security/JNLPAppVerifier.java index 9dcfaf5..cbc9db0 100644 --- a/netx/net/sourceforge/jnlp/security/JNLPAppVerifier.java +++ b/netx/net/sourceforge/jnlp/security/JNLPAppVerifier.java @@ -40,7 +40,6 @@ package net.sourceforge.jnlp.security; import static net.sourceforge.jnlp.runtime.Translator.R; import java.security.cert.CertPath; -import java.util.HashMap; import java.util.Map; import net.sourceforge.jnlp.JNLPFile; @@ -53,8 +52,8 @@ public class JNLPAppVerifier implements AppVerifier { @Override public boolean hasAlreadyTrustedPublisher( - HashMap<CertPath, CertInformation> certs, - HashMap<String, Integer> signedJars) { + Map<CertPath, CertInformation> certs, + Map<String, Integer> signedJars) { int sumOfSignableEntries = JarCertVerifier.getTotalJarEntries(signedJars); for (CertInformation certInfo : certs.values()) { Map<String, Integer> certSignedJars = certInfo.getSignedJars(); @@ -68,8 +67,8 @@ public class JNLPAppVerifier implements AppVerifier { } @Override - public boolean hasRootInCacerts(HashMap<CertPath, CertInformation> certs, - HashMap<String, Integer> signedJars) { + public boolean hasRootInCacerts(Map<CertPath, CertInformation> certs, + Map<String, Integer> signedJars) { int sumOfSignableEntries = JarCertVerifier.getTotalJarEntries(signedJars); for (CertInformation certInfo : certs.values()) { Map<String, Integer> certSignedJars = certInfo.getSignedJars(); @@ -83,8 +82,8 @@ public class JNLPAppVerifier implements AppVerifier { } @Override - public boolean isFullySigned(HashMap<CertPath, CertInformation> certs, - HashMap<String, Integer> signedJars) { + public boolean isFullySigned(Map<CertPath, CertInformation> certs, + Map<String, Integer> signedJars) { int sumOfSignableEntries = JarCertVerifier.getTotalJarEntries(signedJars); for (CertPath cPath : certs.keySet()) { // If this cert has signed everything, return true diff --git a/netx/net/sourceforge/jnlp/security/PluginAppVerifier.java b/netx/net/sourceforge/jnlp/security/PluginAppVerifier.java index a8589d8..f08b4b0 100644 --- a/netx/net/sourceforge/jnlp/security/PluginAppVerifier.java +++ b/netx/net/sourceforge/jnlp/security/PluginAppVerifier.java @@ -41,7 +41,8 @@ import static net.sourceforge.jnlp.runtime.Translator.R; import java.security.cert.CertPath; import java.util.ArrayList; -import java.util.HashMap; +import java.util.List; +import java.util.Map; import net.sourceforge.jnlp.JNLPFile; import net.sourceforge.jnlp.LaunchException; @@ -53,8 +54,8 @@ public class PluginAppVerifier implements AppVerifier { @Override public boolean hasAlreadyTrustedPublisher( - HashMap<CertPath, CertInformation> certs, - HashMap<String, Integer> signedJars) { + Map<CertPath, CertInformation> certs, + Map<String, Integer> signedJars) { boolean allPublishersTrusted = true; @@ -77,8 +78,8 @@ public class PluginAppVerifier implements AppVerifier { } @Override - public boolean hasRootInCacerts(HashMap<CertPath, CertInformation> certs, - HashMap<String, Integer> signedJars) { + public boolean hasRootInCacerts(Map<CertPath, CertInformation> certs, + Map<String, Integer> signedJars) { boolean allRootCAsTrusted = true; @@ -101,8 +102,8 @@ public class PluginAppVerifier implements AppVerifier { } @Override - public boolean isFullySigned(HashMap<CertPath, CertInformation> certs, - HashMap<String, Integer> signedJars) { + public boolean isFullySigned(Map<CertPath, CertInformation> certs, + Map<String, Integer> signedJars) { boolean isFullySigned = true; @@ -127,8 +128,8 @@ public class PluginAppVerifier implements AppVerifier { @Override public void checkTrustWithUser(JarCertVerifier jcv, JNLPFile file) throws LaunchException { - ArrayList<CertPath> certPaths = buildCertPathsList(jcv); - ArrayList<CertPath> alreadyApprovedByUser = new ArrayList<CertPath>(); + List<CertPath> certPaths = buildCertPathsList(jcv); + List<CertPath> alreadyApprovedByUser = new ArrayList<CertPath>(); for (String jarName : jcv.getJarSignableEntries().keySet()) { boolean trustFoundOrApproved = false; for (CertPath cPathApproved : alreadyApprovedByUser) { @@ -190,9 +191,9 @@ public class PluginAppVerifier implements AppVerifier { * 3. Roots in the CA store but have signing issues * 4. Everything else */ - public ArrayList<CertPath> buildCertPathsList(JarCertVerifier jcv) { - ArrayList<CertPath> certPathsList = jcv.getCertsList(); - ArrayList<CertPath> returnList = new ArrayList<CertPath>(); + public List<CertPath> buildCertPathsList(JarCertVerifier jcv) { + List<CertPath> certPathsList = jcv.getCertsList(); + List<CertPath> returnList = new ArrayList<CertPath>(); for (CertPath cPath : certPathsList) { if (!returnList.contains(cPath) |