<!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.Identity
</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.DigestOutputStream.html#_top_">Previous</a>  <a href="java.security.IdentityScope.html#_top_">Next</a>  <a href="AllNames.html">Index</a></pre>
<hr>
<h1>
  Class java.security.Identity
</h1>
<pre>
<a href="java.lang.Object.html#_top_">java.lang.Object</a>
   |
   +----java.security.Identity
</pre>
<hr>
<dl>
  <dt> public abstract class <b>Identity</b>
  <dt> extends <a href="java.lang.Object.html#_top_">Object</a>
  <dt> implements <a href="java.security.Principal.html#_top_">Principal</a>, <a href="java.io.Serializable.html#_top_">Serializable</a>
</dl>
<p>This class represents identities: real-world objects such as people,
 companies or organizations whose identities can be authenticated using 
 their public keys. Identities may also be more abstract (or concrete) 
 constructs, such as daemon threads or smart cards.
 <p>All Identity objects have a name and a public key. Names are
 immutable. Identities may also be scoped. That is, if an Identity is
 specified to have a particular scope, then the name and public
 key of the Identity are unique within that scope.
 <p>An Identity also has a set of certificates (all certifying its own
 public key). The Principal names specified in these certificates need 
 not be the same, only the key.
 <p>An Identity can be subclassed, to include postal and email addresses,
 telephone numbers, images of faces and logos, and so on.
<p>
<dl>
    <dt> <b>See Also:</b>
    <dd> <a href="java.security.IdentityScope.html#_top_">IdentityScope</a>, <a href="java.security.Signer.html#_top_">Signer</a>, <a href="java.security.Principal.html#_top_">Principal</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="#Identity()"><b>Identity</b></a>()
  <dd>  Constructor for serialization only.
  <dt> <img src="images/yellow-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#Identity(java.lang.String)"><b>Identity</b></a>(String)
  <dd>  Constructs an identity with the specified name and no scope.
  <dt> <img src="images/yellow-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#Identity(java.lang.String, java.security.IdentityScope)"><b>Identity</b></a>(String, IdentityScope)
  <dd>  Constructs an identity 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="#addCertificate(java.security.Certificate)"><b>addCertificate</b></a>(Certificate)
  <dd>  Adds a certificate for this identity.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#certificates()"><b>certificates</b></a>()
  <dd>  Returns a copy of all the certificates for this identity.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#equals(java.lang.Object)"><b>equals</b></a>(Object)
  <dd>  Tests for equality between the specified object and this identity.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#getInfo()"><b>getInfo</b></a>()
  <dd>  Returns general information previously specified for this identity.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#getName()"><b>getName</b></a>()
  <dd>  Returns this identity's name.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#getPublicKey()"><b>getPublicKey</b></a>()
  <dd>  Returns this identity's public key.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#getScope()"><b>getScope</b></a>()
  <dd>  Returns this identity's scope.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#hashCode()"><b>hashCode</b></a>()
  <dd>  Returns a hashcode for this identity.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#identityEquals(java.security.Identity)"><b>identityEquals</b></a>(Identity)
  <dd>  Tests for equality between the specified identity and this identity.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#removeCertificate(java.security.Certificate)"><b>removeCertificate</b></a>(Certificate)
  <dd>  Removes a certificate from this identity.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#setInfo(java.lang.String)"><b>setInfo</b></a>(String)
  <dd>  Specifies a general information string for this identity.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#setPublicKey(java.security.PublicKey)"><b>setPublicKey</b></a>(PublicKey)
  <dd>  Sets this identity's public key.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#toString()"><b>toString</b></a>()
  <dd>  Returns a short string describing this identity, telling its
 name and its scope (if any).
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#toString(boolean)"><b>toString</b></a>(boolean)
  <dd>  Returns a string representation of this identity, with
 optionally more details than that provided by the
 <code>toString</code> method without any arguments.
</dl>
<a name="constructors"></a>
<h2>
  <img src="images/constructors.gif" width=231 height=38 alt="Constructors">
</h2>
<a name="Identity"></a>
<a name="Identity()"><img src="images/yellow-ball.gif" width=12 height=12 alt=" o "></a>
<b>Identity</b>
<pre>
 protected Identity()
</pre>
<dl>
  <dd> Constructor for serialization only.
<p>
</dl>
<a name="Identity(java.lang.String, java.security.IdentityScope)"><img src="images/yellow-ball.gif" width=12 height=12 alt=" o "></a>
<b>Identity</b>
<pre>
 public Identity(<a href="java.lang.String.html#_top_">String</a> name,
                 <a href="java.security.IdentityScope.html#_top_">IdentityScope</a> scope) throws <a href="java.security.KeyManagementException.html#_top_">KeyManagementException</a>
</pre>
<dl>
  <dd> Constructs an identity with the specified name and scope.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> name - the identity name.
    <dd> scope - the scope of the identity.
    <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="Identity(java.lang.String)"><img src="images/yellow-ball.gif" width=12 height=12 alt=" o "></a>
<b>Identity</b>
<pre>
 public Identity(<a href="java.lang.String.html#_top_">String</a> name)
</pre>
<dl>
  <dd> Constructs an identity with the specified name and no scope.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> name - the identity name.
  </dl></dd>
</dl>
<a name="methods"></a>
<h2>
  <img src="images/methods.gif" width=151 height=38 alt="Methods">
</h2>
<a name="getName()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="getName"><b>getName</b></a>
<pre>
 public final <a href="java.lang.String.html#_top_">String</a> getName()
</pre>
<dl>
  <dd> Returns this identity's name.
<p>
  <dd><dl>
    <dt> <b>Returns:</b>
    <dd> the name of this identity.
  </dl></dd>
</dl>
<a name="getScope()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="getScope"><b>getScope</b></a>
<pre>
 public final <a href="java.security.IdentityScope.html#_top_">IdentityScope</a> getScope()
</pre>
<dl>
  <dd> Returns this identity's scope.
<p>
  <dd><dl>
    <dt> <b>Returns:</b>
    <dd> the scope of this identity.
  </dl></dd>
</dl>
<a name="getPublicKey()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="getPublicKey"><b>getPublicKey</b></a>
<pre>
 public <a href="java.security.PublicKey.html#_top_">PublicKey</a> getPublicKey()
</pre>
<dl>
  <dd> Returns this identity's public key.
<p>
  <dd><dl>
    <dt> <b>Returns:</b>
    <dd> the public key for this identity.
  </dl></dd>
</dl>
<a name="setPublicKey(java.security.PublicKey)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="setPublicKey"><b>setPublicKey</b></a>
<pre>
 public void setPublicKey(<a href="java.security.PublicKey.html#_top_">PublicKey</a> key) throws <a href="java.security.KeyManagementException.html#_top_">KeyManagementException</a>
</pre>
<dl>
  <dd> Sets this identity's public key. The old key and all of this
 identity's certificates are removed by this operation.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> key - the public key for this identity.
    <dt> <b>Throws:</b> <a href="java.security.KeyManagementException.html#_top_">KeyManagementException</a>
    <dd> if another identity in the
 identity's scope has the same public key, or if another exception occurs.
  </dl></dd>
</dl>
<a name="setInfo(java.lang.String)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="setInfo"><b>setInfo</b></a>
<pre>
 public void setInfo(<a href="java.lang.String.html#_top_">String</a> info)
</pre>
<dl>
  <dd> Specifies a general information string for this identity.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> info - the information string.
    <dt> <b>See Also:</b>
    <dd> <a href="#getInfo">getInfo</a>
  </dl></dd>
</dl>
<a name="getInfo()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="getInfo"><b>getInfo</b></a>
<pre>
 public <a href="java.lang.String.html#_top_">String</a> getInfo()
</pre>
<dl>
  <dd> Returns general information previously specified for this identity.
<p>
  <dd><dl>
    <dt> <b>Returns:</b>
    <dd> general information about this identity.
    <dt> <b>See Also:</b>
    <dd> <a href="#setInfo">setInfo</a>
  </dl></dd>
</dl>
<a name="addCertificate(java.security.Certificate)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="addCertificate"><b>addCertificate</b></a>
<pre>
 public void addCertificate(<a href="java.security.Certificate.html#_top_">Certificate</a> certificate) throws <a href="java.security.KeyManagementException.html#_top_">KeyManagementException</a>
</pre>
<dl>
  <dd> Adds a certificate for this identity. If the identity has a public
 key, the public key in the certificate must be the same, and if
 the identity does not have a public key, the identity's
 public key is set to be that specified in the certificate.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> certificate - the certificate to be added.
    <dt> <b>Throws:</b> <a href="java.security.KeyManagementException.html#_top_">KeyManagementException</a>
    <dd> if the certificate is not valid,
 if the public key in the certificate being added conflicts with
 this identity's public key, or if another exception occurs.
  </dl></dd>
</dl>
<a name="removeCertificate(java.security.Certificate)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="removeCertificate"><b>removeCertificate</b></a>
<pre>
 public void removeCertificate(<a href="java.security.Certificate.html#_top_">Certificate</a> certificate) throws <a href="java.security.KeyManagementException.html#_top_">KeyManagementException</a>
</pre>
<dl>
  <dd> Removes a certificate from this identity.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> certificate - the certificate to be removed.
    <dt> <b>Throws:</b> <a href="java.security.KeyManagementException.html#_top_">KeyManagementException</a>
    <dd> if the certificate is
 missing, or if another exception occurs.
  </dl></dd>
</dl>
<a name="certificates()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="certificates"><b>certificates</b></a>
<pre>
 public <a href="java.security.Certificate.html#_top_">Certificate</a>[] certificates()
</pre>
<dl>
  <dd> Returns a copy of all the certificates for this identity.
<p>
  <dd><dl>
    <dt> <b>Returns:</b>
    <dd> a copy of all the certificates for this identity.
  </dl></dd>
</dl>
<a name="equals(java.lang.Object)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="equals"><b>equals</b></a>
<pre>
 public final boolean equals(<a href="java.lang.Object.html#_top_">Object</a> identity)
</pre>
<dl>
  <dd> Tests for equality between the specified object and this identity.
 This first tests to see if the entities actually refer to the same
 object, in which case it returns true. Next, it checks to see if
 the entities have the same name and the same scope. If they do, 
 the method returns true. Otherwise, it calls <a href = 
 "#identityEquals">identityEquals</a>, which subclasses should 
 override.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> identity - the object to test for equality with this identity.
    <dt> <b>Returns:</b>
    <dd> true if the objects are considered equal, false otherwise.
    <dt> <b>Overrides:</b>
    <dd> <a href="java.lang.Object.html#equals(java.lang.Object)">equals</a> in class <a href="java.lang.Object.html#_top_">Object</a>
    <dt> <b>See Also:</b>
    <dd> <a href="#identityEquals">identityEquals</a>
  </dl></dd>
</dl>
<a name="identityEquals(java.security.Identity)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="identityEquals"><b>identityEquals</b></a>
<pre>
 protected boolean identityEquals(<a href="#_top_">Identity</a> identity)
</pre>
<dl>
  <dd> Tests for equality between the specified identity and this identity.
 This method should be overriden by subclasses to test for equality. 
 The default behavior is to return true if the names and public keys 
 are equal.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> identity - the identity to test for equality with this identity.
    <dt> <b>Returns:</b>
    <dd> true if the identities are considered equal, false
 otherwise.
    <dt> <b>See Also:</b>
    <dd> <a href="#equals">equals</a>
  </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 short string describing this identity, telling its
 name and its scope (if any).
<p>
  <dd><dl>
    <dt> <b>Returns:</b>
    <dd> information about this identity, such as its name and the
 name of its scope (if any).
    <dt> <b>Overrides:</b>
    <dd> <a href="java.lang.Object.html#toString()">toString</a> in class <a href="java.lang.Object.html#_top_">Object</a>
  </dl></dd>
</dl>
<a name="toString(boolean)"><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(boolean detailed)
</pre>
<dl>
  <dd> Returns a string representation of this identity, with
 optionally more details than that provided by the
 <code>toString</code> method without any arguments.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> detailed - whether or not to provide detailed information.
    <dt> <b>Returns:</b>
    <dd> information about this identity. If <code>detailed</code>
 is true, then this method returns more information than that 
 provided by the <code>toString</code> method without any arguments.
    <dt> <b>See Also:</b>
    <dd> <a href="#toString">toString</a>
  </dl></dd>
</dl>
<a name="hashCode()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="hashCode"><b>hashCode</b></a>
<pre>
 public int hashCode()
</pre>
<dl>
  <dd> Returns a hashcode for this identity.
<p>
  <dd><dl>
    <dt> <b>Returns:</b>
    <dd> a hashcode for this identity.
    <dt> <b>Overrides:</b>
    <dd> <a href="java.lang.Object.html#hashCode()">hashCode</a> in class <a href="java.lang.Object.html#_top_">Object</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.DigestOutputStream.html#_top_">Previous</a>  <a href="java.security.IdentityScope.html#_top_">Next</a>  <a href="AllNames.html">Index</a></pre>
</body>
</html>
