java.security
public abstract class Identity extends Object implements Principal, Serializable
Deprecated: Replaced by java.security.KeyStore
, the
java.security.cert
package, and
java.security.Principal
.
Identity
class is used to represent people and companies
that can be authenticated using public key encryption. The identities can
also be abstract objects such as smart cards.
Identity
objects store a name and public key for each
identity. The names cannot be changed and the identities can be scoped. Each
identity (name and public key) within a scope are unique to that scope.
Each identity has a set of ceritificates which all specify the same public key, but not necessarily the same name.
The Identity
class can be subclassed to allow additional
information to be attached to it.
See Also: IdentityScope Signer Principal
Constructor Summary | |
---|---|
protected | Identity() Constructor for serialization only. |
Identity(String name, IdentityScope scope)
Constructs a new instance of Identity with the specified
name and scope.
| |
Identity(String name)
Constructs a new instance of Identity with the specified
name and no scope.
|
Method Summary | |
---|---|
void | addCertificate(Certificate certificate)
Adds a certificate to the list of ceritificates for this identity. |
Certificate[] | certificates() |
boolean | equals(Object identity)
Checks for equality between this Identity and a specified object. |
String | getInfo() |
String | getName() |
PublicKey | getPublicKey() |
IdentityScope | getScope() |
int | hashCode() |
protected boolean | identityEquals(Identity identity)
Checks for equality between this Identity and a specified object. |
void | removeCertificate(Certificate certificate)
Removes a certificate from the list of ceritificates for this identity.
|
void | setInfo(String info)
Sets the general information string.
|
void | setPublicKey(PublicKey key)
Sets the public key for this identity. |
String | toString()
Returns a string representation of this Identity.
|
String | toString(boolean detailed)
Returns a detailed string representation of this Identity.
|
Identity
with the specified
name and scope.
Parameters: name the name to use. scope the scope to use.
Throws: KeyManagementException if the identity is already present.
Identity
with the specified
name and no scope.
Parameters: name the name to use.
Parameters: certificate the certificate to add.
Throws: KeyManagementException if the certificate is invalid, or the public key conflicts. SecurityException if a {@link SecurityManager} is installed which disallows this operation.
Returns: an array of {@link Certificate}s for this identity.
true
if successful. If these tests fail, the
{@link #identityEquals(Identity)} method is called.
Returns: true
if they are equal, false
otherwise.
Returns: the general information string of this identity.
See Also: setInfo
Returns: the name of this identity.
Returns: the public key of this identity.
See Also: setPublicKey
Returns: the scope of this identity.
Returns: a hashcode of this identity.
true
if the public key and names match.
Returns: true
if they are equal, false
otherwise.
Parameters: certificate the certificate to remove.
Throws: KeyManagementException if the certificate is invalid. SecurityException if a {@link SecurityManager} is installed which disallows this operation.
Parameters: info the general information string.
Throws: SecurityException if a {@link SecurityManager} is installed which disallows this operation.
Parameters: key the public key to use.
Throws: KeyManagementException if this public key is used by another identity in the current scope. SecurityException if a {@link SecurityManager} is installed which disallows this operation.
Returns: a string representation of this Identity.
Throws: SecurityException if a {@link SecurityManager} is installed which disallows this operation.
Parameters: detailed indicates whether or detailed information is desired.
Returns: a string representation of this Identity.
Throws: SecurityException if a {@link SecurityManager} is installed which disallows this operation.