Microsoft SDK for Java

Security Samples

Trust-based security for Java is a cross-platform security model that provides fine-grained administration of the permissions granted to Java applets and libraries. This permission model provides control over what a Java class can do by providing a way to associate a set of permissions with a class. Encoding the permission set in the digital signature allows the Microsoft virtual machine to present the end user with a dialog box that lists the requested permissions so that the user can decide whether to trust the applet. For more information, see Security.

The following security samples are provided.

Sample Description
Custom Permissions Location: \Samples\Security\Custom

Technologies: Security

Demonstrates:

  • Setting custom permissions to protect resources that are not described by the stock permissions in com.ms.security.permissions.
Classloader Security Location: \Samples\Security\Loader

Technologies: Security

Demonstrates:

  • Setting security attributes on class files as they are loaded by implementing a secure class loader.
COM Security Location: \Samples\Com\Security_com

Technologies: COM, security

Demonstrates:

  • Implementing Call security on a Java/COM object using the com.ms.security package.

  • Implementing a Java/COM object with a custom interface.

  • Implementing a C COM object with a custom interface.

  • Defining a custom interface in IDL.
RNI Security Location: \Samples\Security\Rni

Technologies: Security, RNI

Demonstrates:

  • Protecting access to resources from native code.
INI Files for Java Code Signing Location: \Samples\Security\sign

Technologies: Security, code signing, scripting

Demonstrates:

  • Using .ini files to sign Java code. Several sample .ini files are provided, showing high, medium, and low permissions.

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