![]() |
The Java Developers Almanac 1.4 |
|
e193. Printing Security System Trace MessagesBy setting the system propertyjava.security.debug to all,
the security system will print details of security related calls. The
value all prints all available debugging information. For finer
control of what is printed, see:
http://java.sun.com/j2se/1.4/docs/guide/plugin/developer_guide/debugger.html#jsdpHere's an example of setting the system property on the command line: java -Djava.security.debug=all MyAppHere's a sample of trace messages: access: access allowed (java.io.FilePermission c:\file1 read)
access: access allowed (java.io.FilePermission c:\file2 write)
access: access denied (java.util.PropertyPermission user.home read)
Exception in thread "main" java.security.AccessControlException: access denied (
java.util.PropertyPermission user.home read)
at java.security.AccessControlContext.checkPermission(AccessControlContext.java:270)
at java.security.AccessController.checkPermission(AccessController.java:401)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:542)
at java.lang.SecurityManager.checkPropertyAccess(SecurityManager.java:1291)
at java.lang.System.getProperty(System.java:572)
at MyApp.main(MyApp.java:50)
e195. Listing All Available Secure Random Number Generators e196. Generating a Secure Random Number
© 2002 Addison-Wesley. |