diff options
author | Omair Majid <[email protected]> | 2011-01-12 12:50:13 -0500 |
---|---|---|
committer | Omair Majid <[email protected]> | 2011-01-12 12:50:13 -0500 |
commit | 89f754862df381147217093df8eb241feb62aaf4 (patch) | |
tree | 55add0e1b8bba245ab6261f841892f08580f1e61 /netx/net/sourceforge/jnlp/security | |
parent | 9679f89fa9b4db346cf898924e20e630c509838c (diff) |
fix problems in control panel caused by removing JNLPRuntime.initialize()
2011-01-12 Omair Majid <[email protected]>
* netx/net/sourceforge/jnlp/controlpanel/ControlPanel.java
(main): Set look and feel. Set config object to use with KeyStores.
* netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java
(initialize): Set config object to use with KeyStores.
* netx/net/sourceforge/jnlp/security/KeyStores.java: Add new member
config.
(setConfiguration): New method. Sets the value of config after security
check.
(getKeyStoreLocation): Use config object instead of querying JNLPRuntime.
Diffstat (limited to 'netx/net/sourceforge/jnlp/security')
-rw-r--r-- | netx/net/sourceforge/jnlp/security/KeyStores.java | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/netx/net/sourceforge/jnlp/security/KeyStores.java b/netx/net/sourceforge/jnlp/security/KeyStores.java index e7a83d5..12da0c8 100644 --- a/netx/net/sourceforge/jnlp/security/KeyStores.java +++ b/netx/net/sourceforge/jnlp/security/KeyStores.java @@ -51,7 +51,6 @@ import java.util.List; import java.util.StringTokenizer; import net.sourceforge.jnlp.config.DeploymentConfiguration; -import net.sourceforge.jnlp.runtime.JNLPRuntime; import net.sourceforge.jnlp.runtime.Translator; import net.sourceforge.jnlp.util.FileUtils; @@ -76,6 +75,8 @@ public final class KeyStores { CLIENT_CERTS, } + private static DeploymentConfiguration config = null; + private static final String KEYSTORE_TYPE = "JKS"; /** the default password used to protect the KeyStores */ private static final String DEFAULT_PASSWORD = "changeit"; @@ -84,6 +85,16 @@ public final class KeyStores { return DEFAULT_PASSWORD.toCharArray(); } + /** Set the configuration object to use for getting KeyStore paths */ + public static void setConfiguration(DeploymentConfiguration newConfig) { + SecurityManager sm = System.getSecurityManager(); + if (sm != null) { + sm.checkPermission(new AllPermission()); + } + + config = newConfig; + } + /** * Returns a KeyStore corresponding to the appropriate level level (user or * system) and type. @@ -272,7 +283,7 @@ public final class KeyStores { throw new RuntimeException("Unspported"); } - return JNLPRuntime.getConfiguration().getProperty(configKey); + return config.getProperty(configKey); } /** |