The Java Developers Almanac 1.4


Order this book from Amazon.

   
Home > List of Packages > java.security  [30 examples]

e193. Printing Security System Trace Messages

By setting the system property java.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#jsdp
Here's an example of setting the system property on the command line:
    java -Djava.security.debug=all MyApp

Here'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)

 Related Examples
e194. Listing All Available Cryptographic Services
e195. Listing All Available Secure Random Number Generators
e196. Generating a Secure Random Number

See also: Key Store    Message Digests    Permissions    Policy Files    Public and Private Keys    Signatures   


© 2002 Addison-Wesley.