<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<!--NewPage-->
<html>
<head>
<!-- Generated by javadoc on Wed Jul 28 01:21:15 GMT 1999 -->
<title>
  Class java.security.Security
</title>
</head>
<body>
<a name="_top_"></a>
<pre>
<a href="packages.html">All Packages</a>  <a href="tree.html">Class Hierarchy</a>  <a href="Package-java.security.html">This Package</a>  <a href="java.security.SecureRandom.html#_top_">Previous</a>  <a href="java.security.Signature.html#_top_">Next</a>  <a href="AllNames.html">Index</a></pre>
<hr>
<h1>
  Class java.security.Security
</h1>
<pre>
<a href="java.lang.Object.html#_top_">java.lang.Object</a>
   |
   +----java.security.Security
</pre>
<hr>
<dl>
  <dt> public final class <b>Security</b>
  <dt> extends <a href="java.lang.Object.html#_top_">Object</a>
</dl>
<p>This class centralizes all security properties and common security
 methods. One of its primary uses is to manage providers.
<p>
<hr>
<a name="index"></a>
<h2>
  <img src="images/method-index.gif" width=207 height=38 alt="Method Index">
</h2>
<dl>
  <dt> <img src="images/green-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#addProvider(java.security.Provider)"><b>addProvider</b></a>(Provider)
  <dd>  Adds a provider to the next position available.
  <dt> <img src="images/green-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#getAlgorithmProperty(java.lang.String, java.lang.String)"><b>getAlgorithmProperty</b></a>(String, String)
  <dd>  Gets a specified property for an algorithm.
  <dt> <img src="images/green-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#getProperty(java.lang.String)"><b>getProperty</b></a>(String)
  <dd>  Gets a security property.
  <dt> <img src="images/green-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#getProvider(java.lang.String)"><b>getProvider</b></a>(String)
  <dd>  Returns the provider installed with the specified name, if
 any.
  <dt> <img src="images/green-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#getProviders()"><b>getProviders</b></a>()
  <dd>  Returns all providers currently installed.
  <dt> <img src="images/green-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#insertProviderAt(java.security.Provider, int)"><b>insertProviderAt</b></a>(Provider, int)
  <dd>  Adds a new provider, at a specified position.
  <dt> <img src="images/green-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#removeProvider(java.lang.String)"><b>removeProvider</b></a>(String)
  <dd>  Removes the provider with the specified name.
  <dt> <img src="images/green-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#setProperty(java.lang.String, java.lang.String)"><b>setProperty</b></a>(String, String)
  <dd>  Sets a security property.
</dl>
<a name="methods"></a>
<h2>
  <img src="images/methods.gif" width=151 height=38 alt="Methods">
</h2>
<a name="getAlgorithmProperty(java.lang.String, java.lang.String)"><img src="images/green-ball.gif" width=12 height=12 alt=" o "></a>
<a name="getAlgorithmProperty"><b>getAlgorithmProperty</b></a>
<pre>
 public static <a href="java.lang.String.html#_top_">String</a> getAlgorithmProperty(<a href="java.lang.String.html#_top_">String</a> algName,
                                           <a href="java.lang.String.html#_top_">String</a> propName)
</pre>
<dl>
  <dd> Gets a specified property for an algorithm. The algorithm name
 should be a standard name. See Appendix A in the <a href=
 "../guide/security/CryptoSpec.html#AppA">
 Java Cryptography Architecture API Specification &amp; Reference </a>
 for information about standard algorithm names.
 One possible use is by specialized algorithm parsers, which may map
 classes to algorithms which they understand (much like Key parsers
 do).
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> algName - the algorithm name.
    <dd> propName - the name of the property to get.
    <dt> <b>Returns:</b>
    <dd> the value of the specified property.
  </dl></dd>
</dl>
<a name="insertProviderAt(java.security.Provider, int)"><img src="images/green-ball.gif" width=12 height=12 alt=" o "></a>
<a name="insertProviderAt"><b>insertProviderAt</b></a>
<pre>
 public static int insertProviderAt(<a href="java.security.Provider.html#_top_">Provider</a> provider,
                                    int position)
</pre>
<dl>
  <dd> Adds a new provider, at a specified position. The position is
 the preference order in which providers are searched for
 requested algorithms. Note that it is not guaranteed that this
 preference will be respected. The position is 1-based, that is,
 1 is most preferred, followed by 2, and so on. Sometimes it
 will be legal to add a provider, but only in the last position,
 in which case the <code>position</code> argument will be ignored.
 <p>If the given provider is installed at the requested position,
 the provider that used to be at that position, and all providers
 with a position greater than <code>position</code>, are shifted up
 one position (towards the end of the list of installed providers).
 <p>A provider cannot be added if it is already installed.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> provider - the provider to be added.
    <dd> position - the preference position that the caller would
 like for this provider.
    <dt> <b>Returns:</b>
    <dd> the actual preference position in which the provider was
 added, or -1 if the provider was not added because it is
 already installed.
    <dt> <b>See Also:</b>
    <dd> <a href="#getProvider">getProvider</a>, <a href="#removeProvider">removeProvider</a>
  </dl></dd>
</dl>
<a name="addProvider(java.security.Provider)"><img src="images/green-ball.gif" width=12 height=12 alt=" o "></a>
<a name="addProvider"><b>addProvider</b></a>
<pre>
 public static int addProvider(<a href="java.security.Provider.html#_top_">Provider</a> provider)
</pre>
<dl>
  <dd> Adds a provider to the next position available.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> provider - the provider to be added.
    <dt> <b>Returns:</b>
    <dd> the preference position in which the provider was
 added, or -1 if the provider was not added because it is
 already installed.
    <dt> <b>See Also:</b>
    <dd> <a href="#getProvider">getProvider</a>, <a href="#removeProvider">removeProvider</a>
  </dl></dd>
</dl>
<a name="removeProvider(java.lang.String)"><img src="images/green-ball.gif" width=12 height=12 alt=" o "></a>
<a name="removeProvider"><b>removeProvider</b></a>
<pre>
 public static void removeProvider(<a href="java.lang.String.html#_top_">String</a> name)
</pre>
<dl>
  <dd> Removes the provider with the specified name.
 <p>When the specified provider is removed, all providers located
 at a position greater than where the specified provider was are shifted
 down one position (towards the head of the list of installed providers).
 <p>This method returns silently if the provider is not installed.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> name - the name of the provider to remove.
    <dt> <b>See Also:</b>
    <dd> <a href="#getProvider">getProvider</a>, <a href="#addProvider">addProvider</a>
  </dl></dd>
</dl>
<a name="getProviders()"><img src="images/green-ball.gif" width=12 height=12 alt=" o "></a>
<a name="getProviders"><b>getProviders</b></a>
<pre>
 public static <a href="java.security.Provider.html#_top_">Provider</a>[] getProviders()
</pre>
<dl>
  <dd> Returns all providers currently installed.
<p>
  <dd><dl>
    <dt> <b>Returns:</b>
    <dd> an array of all providers currently installed.
  </dl></dd>
</dl>
<a name="getProvider(java.lang.String)"><img src="images/green-ball.gif" width=12 height=12 alt=" o "></a>
<a name="getProvider"><b>getProvider</b></a>
<pre>
 public static <a href="java.security.Provider.html#_top_">Provider</a> getProvider(<a href="java.lang.String.html#_top_">String</a> name)
</pre>
<dl>
  <dd> Returns the provider installed with the specified name, if
 any. Returns null if no provider with the speicified name is
 installed.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> name - the name of the provider to get.
    <dt> <b>Returns:</b>
    <dd> the provider of the specified name.
    <dt> <b>See Also:</b>
    <dd> <a href="#removeProvider">removeProvider</a>, <a href="#addProvider">addProvider</a>
  </dl></dd>
</dl>
<a name="getProperty(java.lang.String)"><img src="images/green-ball.gif" width=12 height=12 alt=" o "></a>
<a name="getProperty"><b>getProperty</b></a>
<pre>
 public static <a href="java.lang.String.html#_top_">String</a> getProperty(<a href="java.lang.String.html#_top_">String</a> key)
</pre>
<dl>
  <dd> Gets a security property.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> key - the key of the property being retrieved.
    <dt> <b>Returns:</b>
    <dd> the valeu of the security property corresponding to key.
  </dl></dd>
</dl>
<a name="setProperty(java.lang.String, java.lang.String)"><img src="images/green-ball.gif" width=12 height=12 alt=" o "></a>
<a name="setProperty"><b>setProperty</b></a>
<pre>
 public static void setProperty(<a href="java.lang.String.html#_top_">String</a> key,
                                <a href="java.lang.String.html#_top_">String</a> datum)
</pre>
<dl>
  <dd> Sets a security property.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> key - the name of the property to be set.
    <dd> datum - the value of the property to be set.
  </dl></dd>
</dl>
<hr>
<pre>
<a href="packages.html">All Packages</a>  <a href="tree.html">Class Hierarchy</a>  <a href="Package-java.security.html">This Package</a>  <a href="java.security.SecureRandom.html#_top_">Previous</a>  <a href="java.security.Signature.html#_top_">Next</a>  <a href="AllNames.html">Index</a></pre>
</body>
</html>
