Whole document tree
6 Security Management6.1 Managing Applets and ApplicationsCurrently, all Java 2 SDK system code invokes SecurityManager methods to check the policy currently in effect and perform access control checks. There is typically a security manager (SecurityManager implementation) installed whenever an applet is running; the appletviewer and most browsers, including those from Netscape and Microsoft, install a security manager. java -Djava.security.manager SomeApp or the application itself must call the java -Djava.security.manager=COM.abc.MySecMgr SomeApp If no security manager is specified, the built-in default security manager is utilized (unless the application installs a different security manager). All of the following are equivalent and result in usage of the default security manager: java -Djava.security.manager SomeApp java -Djava.security.manager="" SomeApp java -Djava.security.manager=default SomeApp Java 2 SDK includes a property named java.class.path. Classes that are stored on the local file system but should not be treated as base classes (e.g., classes built into the SDK) should be on this path. Classes on this path are loaded with a secure class loader and are thus subjected to the security policy being enforced. java -Djava.security.manager -Djava.security.policy=pURL SomeApp If you instead type the following command, using a double equals, then just the specified policy file will be used; all others will be ignored: java -Djava.security.manager -Djava.security.policy==pURL SomeApp 6.2 SecurityManager versus AccessControllerThe new access control mechanism is fully backward compatible. For example, all 6.3 Auxiliary ToolsThis section briefly describes the usage of three tools that assist in the deployment of the new security features. These tools may be packaged together in the future. /docs/tooldocs/solaris and /docs/tooldocs/win32 subdirectories of the SDK release directory (where the directory separators are actually "\" on Windows systems). /j2sdk1.2/docs/tooldocs/solaris/keytool.html /j2sdk1.2/docs/tooldocs/win32/keytool.html If the Java 2 SDK is installed in a directory named "C:\j2sdk1.2" on a Windows system, then the keytool documentation for Solaris and Windows users, respectively, can be found in C:\j2sdk1.2\docs\tooldocs\solaris\keytool.html C:\j2sdk1.2\docs\tooldocs\win32\keytool.html 6.3.1 The Key and Certificate Management Toolkeytool is a key and certificate management utility. It enables users to administer their own public/private key pairs and associated certificates for use in self-authentication (where the user authenticates himself/herself to other users/services) or data integrity and authentication services, using digital signatures. The authentication information includes both a sequence (chain) of X.509 certificates, and an associated private key, which can be referenced by a so-called "alias". This tool also manages certificates (that are "trusted" by the user), which are stored in the same database as the authentication information, and can be referenced by an "alias". % keytool -help KeyTool usage: -certreq [-v] [-alias <alias>] [-sigalg <sigalg>] [-file <certreq_file>] [-keypass <keypass>] [-keystore <keystore>] [-storepass <storepass>] [-storetype <i>storetype</i>] -delete [-v] -alias <alias> [-keystore <keystore>] [-storepass <storepass>] [-storetype <i>storetype</i>] -export [-v] [rfc] [-alias <alias>] [-file <cert_file>] [-keystore <keystore>] [-storepass <storepass>] [-storetype <i>storetype</i>] -genkey [-v] [-alias <alias>] [-keyalg <keyalg>] [-keysize <keysize>] [-sigalg <sigalg>] [-dname <distinguished_name>] [-validity <valDays>] [-keypass <keypass>] [-keystore <keystore>] [-storepass <storepass>] [-storetype <i>storetype</i>] -help -identitydb [-v] [-file <idb_file>] [-keystore <keystore>] [-storepass <storepass>] [-storetype <i>storetype</i>] -import [-v] [-noprompt] [-alias <alias>] [-file <cert_file>] [-keypass <keypass>] [-keystore <keystore>] [-storepass <storepass>] [-storetype <i>storetype</i>] -keyclone [-v] [-alias <alias>] -dest <dest_alias> [-keypass <keypass>] [-new <new_keypass>] [-keystore <keystore>] [-storepass <storepass>] [-storetype <i>storetype</i>] -keypasswd [-v] [-alias <alias>] [-keypass <old_keypass>] [-new <new_keypass>] [-keystore <keystore>] [-storepass <storepass>] [-storetype <i>storetype</i>] -list [-v | -rfc] [-alias <alias>] [-keystore <keystore>] [-storepass <storepass>] [-storetype <i>storetype</i>] -printcert [-v] [-file <cert_file>] -selfcert [-v] [-alias <alias>] [-sigalg <sigalg>] [-dname <distinguished_name>] [-validity <valDays>] [-keypass <keypass>] [-keystore <keystore>] [-storepass <storepass>] [-storetype <i>storetype</i>] -storepasswd [-v] [-new <new_storepass>] [-keystore <keystore>] [-storepass <storepass>] [-storetype <i>storetype</i>] 6.3.2 Policy ToolThe Policy Tool is a graphical user interface (illustrated below with a screen shot) that assists a user (such as a system administrator) in specifying, generating, editing, exporting, or importing a security policy. The tool is invoked from the command line as /docs/tooldocs/solaris/ or /docs/tooldocs/win32/ directory in the directory in which the SDK was installed (where the file separators are actually backslashes on Windows systems). 6.3.3 The JAR Signing and Verification ToolThe jarsigner tool can be used to digitally sign Java archives (JAR files), and to verify such signatures. This tool, like the Policy Tool, depends on the keystore that is managed by the keytool. Its usage is quickly summarized below. % jarsigner Usage: jarsigner [options] jar-file alias jarsigner -verify [options] jar-file [-keystore <url>] keystore file location [-storepass <password>] password for keystore integrity [-keypass <password>] password for private key (if different) [-sigfile <file>] name of .SF/.DSA file [-signedjar <file>] name of signed JAR file [-verify] verify a signed JAR file [-verbose] verbose output when signing/verifying [-certs] display certificates when verbose and verifying [-internalsf] include .SF file inside signature block [-sectionsonly] don't compute hash of entire manifest Again, this tool is a script built with the SDK. Note that it is expected that this tool and the existing jar tool script may be merged in the near future to form a single command-line primitive to create JARs, either signed or unsigned. CONTENTS | PREV | NEXT Copyright © 1997-1999 Sun Microsystems, Inc. All Rights Reserved. |