setProperty-access in start-method but not in other methods of my applet ?
Hi,
User downloads html withsigned applet, the applet started after trust.
Then I want to set the keystore property with a method that I call from javascript in the html-page. I get a java.security.AccessControlException: access denied (java.util.PropertyPermission javax.net.ssl.keyStore write)
When I set my keystore-property in the start-method of my class, I get no exception and it works. But thats no option because I ask the keystore and the psw in the html-page and want to forward it to the applet.
Thanks for any help!!
HTML-page
<script language="javascript">
function sendKeystore(keystore, keystorepsw){
var appl = document.applets["ECommerceUserApplet"];
appl.setKeystore(keystore,keystorepsw);
}
</script>
The code of my applet
publicvoid setKeyStore(String keystore, String keystorepsw){
System.setProperty("javax.net.ssl.keyStore", keystore);
System.setProperty("javax.net.ssl.keyStorePassword", keystorepsw);
The exception
java.security.AccessControlException: access denied (java.util.PropertyPermission javax.net.ssl.keyStore write)
at java.security.AccessControlContext.checkPermission(Unknown Source)
at java.security.AccessController.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkPermission(Unknown Source)
at java.lang.System.setProperty(Unknown Source)
at eCommerceUser.ECommerceUserApplet.setKeyStore(ECommerceUserApplet.java:33)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at sun.plugin.javascript.invoke.JSInvoke.invoke(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at sun.plugin.javascript.JSClassLoader.invoke(Unknown Source)
at sun.plugin.com.MethodDispatcher.invoke(Unknown Source)
at sun.plugin.com.DispatchImpl.invokeImpl(Unknown Source)
at sun.plugin.com.DispatchImpl$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at sun.plugin.com.DispatchImpl.invoke(Unknown Source)
java.lang.Exception: java.security.AccessControlException: access denied (java.util.PropertyPermission javax.net.ssl.keyStore write)
at sun.plugin.com.DispatchImpl.invokeImpl(Unknown Source)
at sun.plugin.com.DispatchImpl$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at sun.plugin.com.DispatchImpl.invoke(Unknown Source)

