daily pastebin goal
28%
SHARE
TWEET

Untitled

a guest Feb 14th, 2018 62 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. grant {
  2.     permission java.util.PropertyPermission "*", "read,write";
  3.     permission java.net.SocketPermission "192.168.1.1:1024-", "accept,resolve";
  4.     permission java.net.SocketPermission "192.168.1.2:1024-", "accept,resolve";
  5. };
  6.  
  7. //server.policy
  8. // Digital signatures for auth
  9. System.setProperty("javax.net.ssl.keystore", "C:\SSL\serverkeystore.jks");
  10. System.setProperty("javax.net.ssl.keystorePassword", password);
  11. System.setProperty("javax.net.ssl.trustStore", "C:\SSL\servertruststore.jks");
  12. System.setProperty("javax.net.ssl.trustStorePassword", password);
  13.  
  14. // load policy file
  15. System.setProperty("java.security.policy", "C:\server.policy");
  16.  
  17. // use SSL for sockets
  18. registry = LocateRegistry.createRegistry(PORT, new SslRMIClientSocketFactory(), new SslRMIServerSocketFactory());
  19.    
  20. // client policy
  21. grant codebase "file:C:/project/myPlugin/*"{
  22.     permission java.util.PropertyPermission "*", "read,write";
  23.     permission java.net.SocketPermission "192.168.1.100:1199", "connect, resolve";
  24. };
  25.  
  26. // client code
  27. Registry registry = LocateRegistry("192.168.1.100", PORT, new SslRMIClientSocketFactory());
  28. inf = (MyRMIInterface) registry.lookup("//192.168.1.100/My_Server");
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top