<!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.IdentityScope
</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.Identity.html#_top_">Previous</a>  <a href="java.security.KeyPair.html#_top_">Next</a>  <a href="AllNames.html">Index</a></pre>
<hr>
<h1>
  Class java.security.IdentityScope
</h1>
<pre>
<a href="java.lang.Object.html#_top_">java.lang.Object</a>
   |
   +----<a href="java.security.Identity.html#_top_">java.security.Identity</a>
           |
           +----java.security.IdentityScope
</pre>
<hr>
<dl>
  <dt> public abstract class <b>IdentityScope</b>
  <dt> extends <a href="java.security.Identity.html#_top_">Identity</a>
</dl>
<p>This class represents a scope for identities. It is an Identity
 itself, and therefore has a name and can have a scope. It can also
 optionally have a public key and associated certificates.
 <p>An IdentityScope can contain Identity objects of all kinds, including
 Signers. All types of Identity objects can be retrieved, added, and
 removed using the same methods. Note that it is possible, and in fact
 expected, that different types of identity scopes will
 apply different policies for their various operations on the
 various types of Identities.
 <p>There is a one-to-one mapping between keys and identities, and
 there can only be one copy of one key per scope. For example, suppose
 <b>Acme Software, Inc</b> is a software publisher known to a user.
 Suppose it is an Identity, that is, it has a public key, and a set of
 associated certificates. It is named in the scope using the name
 "Acme Software". No other named Identity in the scope has the same
 public  key. Of course, none has the same name as well.
<p>
<dl>
    <dt> <b>See Also:</b>
    <dd> <a href="java.security.Identity.html#_top_">Identity</a>, <a href="java.security.Signer.html#_top_">Signer</a>, <a href="java.security.Principal.html#_top_">Principal</a>, <a href="java.security.Key.html#_top_">Key</a>
</dl>
<hr>
<a name="index"></a>
<h2>
  <img src="images/constructor-index.gif" width=275 height=38 alt="Constructor Index">
</h2>
<dl>
  <dt> <img src="images/yellow-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#IdentityScope()"><b>IdentityScope</b></a>()
  <dd>  This constructor is used for serialization only and should not
 be used by subclasses.
  <dt> <img src="images/yellow-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#IdentityScope(java.lang.String)"><b>IdentityScope</b></a>(String)
  <dd>  Constructs a new identity scope with the specified name.
  <dt> <img src="images/yellow-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#IdentityScope(java.lang.String, java.security.IdentityScope)"><b>IdentityScope</b></a>(String, IdentityScope)
  <dd>  Constructs a new identity scope with the specified name and scope.
</dl>
<h2>
  <img src="images/method-index.gif" width=207 height=38 alt="Method Index">
</h2>
<dl>
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#addIdentity(java.security.Identity)"><b>addIdentity</b></a>(Identity)
  <dd>  Adds an identity to this identity scope.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#getIdentity(java.security.Principal)"><b>getIdentity</b></a>(Principal)
  <dd>  Retrieves the identity whose name is the same as that of the
 specified principal.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#getIdentity(java.security.PublicKey)"><b>getIdentity</b></a>(PublicKey)
  <dd>  Retrieves the identity with the specified public key.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#getIdentity(java.lang.String)"><b>getIdentity</b></a>(String)
  <dd>  Returns the identity in this scope with the specified name (if any).
  <dt> <img src="images/green-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#getSystemScope()"><b>getSystemScope</b></a>()
  <dd>  Returns the system's identity scope.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#identities()"><b>identities</b></a>()
  <dd>  Returns an enumeration of all identities in this identity scope.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#removeIdentity(java.security.Identity)"><b>removeIdentity</b></a>(Identity)
  <dd>  Removes an identity from this identity scope.
  <dt> <img src="images/green-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#setSystemScope(java.security.IdentityScope)"><b>setSystemScope</b></a>(IdentityScope)
  <dd>  Sets the system's identity scope.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#size()"><b>size</b></a>()
  <dd>  Returns the number of identities within this identity scope.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#toString()"><b>toString</b></a>()
  <dd>  Returns a string representation of this identity scope, including
 its name, its scope name, and the number of identities in this
 identity scope.
</dl>
<a name="constructors"></a>
<h2>
  <img src="images/constructors.gif" width=231 height=38 alt="Constructors">
</h2>
<a name="IdentityScope"></a>
<a name="IdentityScope()"><img src="images/yellow-ball.gif" width=12 height=12 alt=" o "></a>
<b>IdentityScope</b>
<pre>
 protected IdentityScope()
</pre>
<dl>
  <dd> This constructor is used for serialization only and should not
 be used by subclasses.
<p>
</dl>
<a name="IdentityScope(java.lang.String)"><img src="images/yellow-ball.gif" width=12 height=12 alt=" o "></a>
<b>IdentityScope</b>
<pre>
 public IdentityScope(<a href="java.lang.String.html#_top_">String</a> name)
</pre>
<dl>
  <dd> Constructs a new identity scope with the specified name.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> name - the scope name.
  </dl></dd>
</dl>
<a name="IdentityScope(java.lang.String, java.security.IdentityScope)"><img src="images/yellow-ball.gif" width=12 height=12 alt=" o "></a>
<b>IdentityScope</b>
<pre>
 public IdentityScope(<a href="java.lang.String.html#_top_">String</a> name,
                      <a href="#_top_">IdentityScope</a> scope) throws <a href="java.security.KeyManagementException.html#_top_">KeyManagementException</a>
</pre>
<dl>
  <dd> Constructs a new identity scope with the specified name and scope.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> name - the scope name.
    <dd> scope - the scope for the new identity scope.
    <dt> <b>Throws:</b> <a href="java.security.KeyManagementException.html#_top_">KeyManagementException</a>
    <dd> if there is already an identity
 with the same name in the scope.
  </dl></dd>
</dl>
<a name="methods"></a>
<h2>
  <img src="images/methods.gif" width=151 height=38 alt="Methods">
</h2>
<a name="getSystemScope()"><img src="images/green-ball.gif" width=12 height=12 alt=" o "></a>
<a name="getSystemScope"><b>getSystemScope</b></a>
<pre>
 public static <a href="#_top_">IdentityScope</a> getSystemScope()
</pre>
<dl>
  <dd> Returns the system's identity scope. See the
 "System Identity Scope" section in the <a href=
 "../guide/security/CryptoSpec.html#SysIdScope">
 Java Cryptography Architecture API Specification &amp; Reference </a>.
<p>
  <dd><dl>
    <dt> <b>Returns:</b>
    <dd> the system's identity scope.
  </dl></dd>
</dl>
<a name="setSystemScope(java.security.IdentityScope)"><img src="images/green-ball.gif" width=12 height=12 alt=" o "></a>
<a name="setSystemScope"><b>setSystemScope</b></a>
<pre>
 protected static void setSystemScope(<a href="#_top_">IdentityScope</a> scope)
</pre>
<dl>
  <dd> Sets the system's identity scope. See the
 "System Identity Scope" section in the <a href=
 "../guide/security/CryptoSpec.html#SysIdScope">
 Java Cryptography Architecture API Specification &amp; Reference </a>.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> scope - the scope to set.
  </dl></dd>
</dl>
<a name="size()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="size"><b>size</b></a>
<pre>
 public abstract int size()
</pre>
<dl>
  <dd> Returns the number of identities within this identity scope.
<p>
  <dd><dl>
    <dt> <b>Returns:</b>
    <dd> the number of identities within this identity scope.
  </dl></dd>
</dl>
<a name="getIdentity(java.lang.String)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="getIdentity"><b>getIdentity</b></a>
<pre>
 public abstract <a href="java.security.Identity.html#_top_">Identity</a> getIdentity(<a href="java.lang.String.html#_top_">String</a> name)
</pre>
<dl>
  <dd> Returns the identity in this scope with the specified name (if any).
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> name - the name of the identity to be retrieved.
    <dt> <b>Returns:</b>
    <dd> the identity named <code>name</code>, or null if there are
 no identities named <code>name</code> in this scope.
  </dl></dd>
</dl>
<a name="getIdentity(java.security.Principal)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="getIdentity"><b>getIdentity</b></a>
<pre>
 public <a href="java.security.Identity.html#_top_">Identity</a> getIdentity(<a href="java.security.Principal.html#_top_">Principal</a> principal)
</pre>
<dl>
  <dd> Retrieves the identity whose name is the same as that of the
 specified principal. (Note: Identity implements Principal.)
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> principal - the principal corresponding to the identity
 to be retrieved.
    <dt> <b>Returns:</b>
    <dd> the identity whose name is the same as that of the
 principal, or null if there are no identities of the same name
 in this scope.
  </dl></dd>
</dl>
<a name="getIdentity(java.security.PublicKey)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="getIdentity"><b>getIdentity</b></a>
<pre>
 public abstract <a href="java.security.Identity.html#_top_">Identity</a> getIdentity(<a href="java.security.PublicKey.html#_top_">PublicKey</a> key)
</pre>
<dl>
  <dd> Retrieves the identity with the specified public key.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> key - the public key for the identity to be returned.
    <dt> <b>Returns:</b>
    <dd> the identity with the given key, or null if there are
 no identities in this scope with that key.
  </dl></dd>
</dl>
<a name="addIdentity(java.security.Identity)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="addIdentity"><b>addIdentity</b></a>
<pre>
 public abstract void addIdentity(<a href="java.security.Identity.html#_top_">Identity</a> identity) throws <a href="java.security.KeyManagementException.html#_top_">KeyManagementException</a>
</pre>
<dl>
  <dd> Adds an identity to this identity scope.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> identity - the identity to be added.
    <dt> <b>Throws:</b> <a href="java.security.KeyManagementException.html#_top_">KeyManagementException</a>
    <dd> if the identity is not
 valid, a name conflict occurs, another identity has the same
 public key as the identity being added, or another exception
 occurs.
  </dl></dd>
</dl>
<a name="removeIdentity(java.security.Identity)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="removeIdentity"><b>removeIdentity</b></a>
<pre>
 public abstract void removeIdentity(<a href="java.security.Identity.html#_top_">Identity</a> identity) throws <a href="java.security.KeyManagementException.html#_top_">KeyManagementException</a>
</pre>
<dl>
  <dd> Removes an identity from this identity scope.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> identity - the identity to be removed.
    <dt> <b>Throws:</b> <a href="java.security.KeyManagementException.html#_top_">KeyManagementException</a>
    <dd> if the identity is missing,
 or another exception occurs.
  </dl></dd>
</dl>
<a name="identities()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="identities"><b>identities</b></a>
<pre>
 public abstract <a href="java.util.Enumeration.html#_top_">Enumeration</a> identities()
</pre>
<dl>
  <dd> Returns an enumeration of all identities in this identity scope.
<p>
  <dd><dl>
    <dt> <b>Returns:</b>
    <dd> an enumeration of all identities in this identity scope.
  </dl></dd>
</dl>
<a name="toString()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="toString"><b>toString</b></a>
<pre>
 public <a href="java.lang.String.html#_top_">String</a> toString()
</pre>
<dl>
  <dd> Returns a string representation of this identity scope, including
 its name, its scope name, and the number of identities in this
 identity scope.
<p>
  <dd><dl>
    <dt> <b>Returns:</b>
    <dd> a string representation of this identity scope.
    <dt> <b>Overrides:</b>
    <dd> <a href="java.security.Identity.html#toString()">toString</a> in class <a href="java.security.Identity.html#_top_">Identity</a>
  </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.Identity.html#_top_">Previous</a>  <a href="java.security.KeyPair.html#_top_">Next</a>  <a href="AllNames.html">Index</a></pre>
</body>
</html>
