Classloader Security Sample

This sample is located in \Samples\Security\Loader.

Description
Using the Sample
Key Project Files
Technologies Demonstrated

Description

This sample shows how to set security attributes on class files as they are loaded by implementing a secure class loader. The sample code contains an implementation of a custom class loader that extends com.ms.security.SecurityClassLoader, and provides a sample application that uses the class loader in an attempt to load system files.

Using the Sample

To compile the sample

Use Nmake.exe to compile the makefile in the \Samples\Security\Loader directory.

To run the sample

Run Demo.bat in the \Samples\Security\Loader directory. Any failure messages will be redirected to Errors.txt.

Key Project Files

demo.java

This file demonstrates the custom class loader that handles security permissions.

FileReader.java

This is a Java class that tries to load a specified file.

perms.ini

This file lists the file permissions to be allowed.

SampleLoader.java

This file is a custom class loader that extends the com.ms.security.SecurityClassLoader. The file contains the pertinent sample information.

Technologies Demonstrated

Security

© 1999 Microsoft Corporation. All rights reserved. Terms of use.