home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / JBuilder8.iso / Solaris / resource / jre / man / sman1 / policytool.1 < prev    next >
Encoding:
Text File  |  2002-09-06  |  9.3 KB  |  173 lines

  1. <!DOCTYPE REFENTRY PUBLIC "-//Sun Microsystems//DTD DocBook V3.0-Based SolBook Subset V2.0//EN" [
  2. <!--ArborText, Inc., 1988-1999, v.4002-->
  3. <!ENTITY % javaents SYSTEM "javaman.ent">
  4. %commonents;
  5. <!ENTITY % booktitles SYSTEM "booktitles.ent">
  6. %booktitles;
  7. ]>
  8. <?Pub UDT _bookmark _target>
  9. <?Pub Inc>
  10. <refentry id="policytool-1">
  11. <!-- @(#)policytool.1 1.1 01/07/18 SMI; -->
  12. <refmeta><refentrytitle>policytool</refentrytitle><manvolnum>1</manvolnum>
  13. <refmiscinfo class="date">18 Jul 2001</refmiscinfo>
  14. <refmiscinfo class="sectdesc">&man1;</refmiscinfo>
  15. <refmiscinfo class="software">&release;</refmiscinfo>
  16. <refmiscinfo class="arch">generic</refmiscinfo>
  17. <refmiscinfo class="copyright">Copyright (c) 1999, Sun Microsystems, Inc.
  18. All Rights Reserved.</refmiscinfo>
  19. <indexterm><primary sortas=""></primary></indexterm><indexterm><primary sortas=""></primary>
  20. </indexterm></refmeta>
  21. <refnamediv><refname>policytool</refname><refpurpose>policy file creation
  22. and management tool</refpurpose></refnamediv>
  23. <refsynopsisdiv><title>&synp-tt;</title>
  24. <cmdsynopsis><command>policytool</command>
  25. </cmdsynopsis></refsynopsisdiv>
  26. <refsect1><title>&desc-tt;</title>
  27. <para>The policy for a Java runtime (specifying which permissions are available
  28. for code from various sources, when executing as various principals) is represented
  29. by a Policy object. The default Policy implementation obtains its information
  30. from static ASCII policy configuration files.</para>
  31. <para>A policy file can be composed via a simple text editor, or via the graphical
  32. Policy Tool utility described here. Using the Policy Tool saves typing and
  33. eliminates the need for you to know the required policy file syntax thus reducing
  34. errors.</para>
  35. </refsect1>
  36. <refsect1><title>Starting Policy Tool</title>
  37. <para>To start Policy Tool, simply type the following at the command line.
  38. </para>
  39. <screen>policytool</screen>
  40. <para>This brings up the "Policy Tool" window.</para>
  41. <para>Whenever Policy Tool is started, it tries to fill in this window with
  42. policy information from what is sometimes referred to as the "user policy
  43. file". The user policy file is by default a file named .java.policy in your
  44. home directory. If Policy Tool cannot find the user policy file, it reports
  45. the situation and displays a blank "Policy Tool" window (that is, a window
  46. with headings             and buttons but no data in it).</para>
  47. <para>You can then proceed to either open whatever policy file you want to
  48. work on or create a new policy file, by adding policy entries, optionally
  49. specifying a keystore, and saving the file).</para>
  50. <para> The first time you run the Policy Tool, there will not be a user policy
  51. file (unless you created one manually).</para>
  52. </refsect1>
  53. <refsect1><title>Creating a new Policy File</title>
  54. <para> To create a new policy file, start by simply selecting the New command
  55. from the File menu. This will close the currently open policy file (if any,
  56. after first prompting you to save it if needed) and bring up a new policy
  57. tool window, that is, a window with headings and buttons but no data in it.
  58. </para>
  59. <para>Please Note: this is not necessary the first time you run the Policy
  60. Tool. Since the tool tries to open the user policy file and one doesn't exist
  61. yet (unless it was created manually), the tool will bring up a window without
  62. any data in it.</para>
  63. <para>Once you have a new policy tool window, you can then create the policy
  64. entries, and specify the keystore (if any of the policy entries specify a
  65. keystore alias). At any point, you can save the policy file.</para>
  66. </refsect1>
  67. <refsect1><title>Opening a Different Policy File</title>
  68. <para>To work on a different policy file than the one currently being worked
  69. on (if any), use the Open command in the File menu.</para>
  70. <para>This will close the currently open policy file (if any, after first
  71. prompting you to save it if needed) and will present you with an Open dialog,
  72. which you can use to navigate the directory structure until you get to the
  73. directory containing the policy file you want to work on. Select         
  74.    that file, then select the OK button.</para>
  75. <para>The "Policy Tool" window will then be filled in with information from
  76. the policy file, including the policy file name, the keystore URL (if any),
  77. and the CodeBase, SignedBy and Principal parts of each policy entry in the
  78. policy file.</para>
  79. </refsect1>
  80. <refsect1><title>Specifying the Keystore</title>
  81. <para> To specify the keystore containing the key information for the aliases
  82. specified in the SignedBy parts of policy entries, select the Change Keystore
  83. command in the Edit menu.</para>
  84. <para>This brings up a dialog box in which you specify the new keystore URL
  85. and optionally the keystore type.</para>
  86. <para> As an example, to specify the keystore named "mykeystore" in the /tests/
  87. directory, type the following file: URL into the text box labeled "New KeyStore
  88. URL".</para>
  89. <screen>file:/tests/mykeystore</screen>
  90. <para>To also specify that the keystore type is "JKS" (the proprietary keystore
  91. type supported by Sun Microsystems), type the following into the text box
  92. labeled "New KeyStore Type".</para>
  93. <screen>JKS</screen>
  94. <para>When you are done specifying the keystore URL and type (if any), select
  95. OK (or you can select Cancel to cancel the operation). If you didn't cancel,
  96. the text box labeled "Keystore:" is now filled in with the keystore URL and
  97. type.</para>
  98. </refsect1>
  99. <refsect1><title>Adding a New Policy Entry</title>
  100. <para>To add a new policy entry, select the Add Policy Entry button in the
  101. main "Policy Tool" window. This brings up a "Policy Entry" dialog box.</para>
  102. <para>Using this dialog box, you specify</para>
  103. <itemizedlist>
  104. <listitem><para>an optional CodeBase entry indicating the URL location where
  105. the code originates from. For example, to indicate code from the local /JavaSoft/TESTS/
  106. directory, type the following file URL into the CodeBase text box:</para>
  107. <screen>file:/JavaSoft/TESTS/</screen>
  108. </listitem>
  109. <listitem><para>an optional SignedBy entry indicating the alias name from
  110. the keystore used to reference the signer whose private key was used to sign
  111. the code. For example, to indicate the alias named "duke", simply type the
  112. following into the SignedBy text box:</para>
  113. <screen>duke</screen>
  114. </listitem>
  115. <listitem><para>an optional Principals entry indicating the list of principals
  116. that the code has to be executed as in order for the permission(s) to be granted.
  117. See Adding a New Principal.</para></listitem>
  118. <listitem><para>one or more permission entries indicating which permissions
  119. are granted to the code from the source indicated by the CodeBase and SignedBy
  120. values (or to any code if no such values are specified) when running as the
  121. specified principals in the Principals list. See Adding a New Permission.
  122. </para></listitem>
  123. </itemizedlist>
  124. </refsect1>
  125. <refsect1><title>Editing a Policy File</title>
  126. <para>To edit an existing policy entry, select the line for that entry in
  127. the main "Policy Tool" window, then select the Edit Policy Entry button. Alternatively,
  128. you can simply double-click the line for that entry.</para>
  129. <para>This brings up the same type of "Policy Entry" dialog box as appears
  130. when you are adding a new policy entry, except in this case the dialog box
  131. is filled in with the existing policy entry information. To change the information,
  132. simply retype it (for the CodeBase and SignedBy values) or use the buttons
  133. (for the Principals and Permissions values).</para>
  134. <para>When you are done, select the Done button (or Cancel to cancel).</para>
  135. </refsect1>
  136. <refsect1><title>Removing a Policy Entry</title>
  137. <para>To delete a policy entry from the policy file, select the line for that
  138. entry in the main "Policy Tool" window, then select the Remove Policy Entry
  139. button.</para>
  140. <para>The complete policy entry is displayed, and you can then either select
  141. OK to remove the entry, or Cancel to keep it.</para>
  142. </refsect1>
  143. <refsect1><title>Saving the Policy File</title>
  144. <para>To save changes to an existing policy file, simply select the Save command
  145. in the File menu.</para>
  146. <para>To save a new policy file you've been creating, or to copy an existing
  147. policy file to a new policy file with a different name, select the Save As
  148. command from the File menu. This brings up the Save As dialog box.</para>
  149. <para>Navigate the directory structure to get to the directory in which you
  150. want to save the policy file. Type the desired file name, then select the
  151. OK button. The policy file is now saved, and its name and path are shown in
  152. the text box labeled "Policy File:"</para>
  153. </refsect1>
  154. <refsect1><title>Exiting the Policy Tool</title>
  155. <para>To exit Policy Tool, select the Exit command from the File menu.</para>
  156. </refsect1>
  157. <refsect1><title>Viewing the Warning Log</title>
  158. <para>If Policy Tool ever reports that warnings have been stored in the Warning
  159. Log, you can view the log by selecting the View Warning Log command in the
  160. Edit menu.</para>
  161. <para>For example, if you have a policy file with a Keystore URL specifying
  162. a keystore that doesn't yet exist, you will get such a warning at various
  163. times, e.g., when you open the file. You can continue to work on the policy
  164. file even if warnings exist.</para>
  165. </refsect1>
  166. <refsect1><title>&also-tt;</title>
  167. <para>More extensive documentation for PolicyTool is available online at 
  168.     <ulink url="http://java.sun.com/j2se/1.4/docs/tooldocs/solaris/policytool.html">
  169. http://java.sun.com/j2se/1.4/docs/tooldocs/solaris/policytool.html</ulink></para><?Pub Caret1>
  170. </refsect1>
  171. </refentry>
  172. <?Pub *0000009520>
  173.