/* Copyright (c) SEMM NL All rights reserved.
Author : Paul Hamaker. Part of JavaLessons.com
This code is for educational purposes only. Use at own risk.*/

1. grant { 

2.   permission java.io.FilePermission 

3.    "C:\\users\\peepo\\cooyuh.dat", "read"

4. }; 

5.  

6. grant codeBase "file:/C:/somepath/api/*"

7.   permission java.security.AllPermission

8.

9.  

10. grant codeBase "file:${tomcat.home}/lib/-"

11.    permission java.security.AllPermission

12.  }; 

13.  

14. grant codeBase "file:${tomcat.home}/webapps/examples"

15.    permission java.net.SocketPermission 

16.     "localhost:1024-","listen"

17.    permission java.util.PropertyPermission 

18.       "*","read"

19. }; 

20.  

21. grant { 

22.     permission java.net.SocketPermission 

23.      "*:1024-65535", "connect,accept"

24.     permission java.net.SocketPermission 

25.      "*:80", "connect"

26. }; 

27.  

28. grant { 

29.     permission java.util.PropertyPermission 

30.      "user.*", "read"

31.     permission java.util.PropertyPermission 

32.      "java.*", "read"

33.   }; 

34.  

35. grant codeBase "file:///e:/someapps/some.jar"

36.        permission java.lang.RuntimePermission 

37.         "queuePrintJob"

38.   }; 

39.  

40. grant signedBy "mick"

41.   permission java.io.FilePermission 

42.    "d:\\work\\*", "read,write"

43. }; 

44.  

45. grant { 

46.   permission java.lang.RuntimePermission "exitVM"

47.   permission java.lang.RuntimePermission "queuePrintJob"

48.   permission java.awt.AWTPermission "accessClipboard"

49.   permission java.awt.AWTPermission "showWindowWithoutWarningBanner"

50.  

51.   permission java.io.FilePermission "<<ALL FILES>>", "read,write"

52. }; 

53.  

54. grant codeBase "http://javalessons.com/-"

55.   permission java.security.AllPermission

56. }; 

57. ============= 

58. c:\winnt\profiles\JamesB 

59.  

60. c:\jdk1.3\jre\lib\security\java.policy 

61. ============= 

62. grant codeBase "file:${java.home}/lib/ext/*"

63.   permission java.security.AllPermission

64. }; 

65.  

66. grant { 

67.   permission java.net.SocketPermission "localhost:1024-", "listen"

68.  

69.   permission java.util.PropertyPermission "java.version", "read"

70.   permission java.util.PropertyPermission "java.vendor", "read"

71.   permission java.util.PropertyPermission "os.name", "read"

72.   permission java.util.PropertyPermission "os.version", "read"

73.   permission java.util.PropertyPermission "file.separator", "read"

74. }; 

75.  

76. ===  ?/jre/lib/security/java.security  ===== 

77. policy.url.3=http://javalessons.com/jl.policy 

78.  OR 

79. policy.url.3=file:/d:/some.policy 

80. ============ 

81. java -Djava.security.manager 

82.   -Djava.security.policy=someURL  SomeApp 

83. ============ 

84. jdk1.3\bin\policytool.exe 

85. ============ 

86. ${/} 

87.