|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.security.Identity
java.security.KeyStore
, the
java.security.cert
package, and
java.security.Principal
.
Untamed:
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.
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.
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.
An Identity can be subclassed, to include postal and email addresses, telephone numbers, images of faces and logos, and so on.
IdentityScope
,
Signer
,
Principal
,
Serialized FormField Summary | |
(package private) Vector |
certificates
Deprecated. The certificates for this identity. |
(package private) String |
info
Deprecated. Generic, descriptive information about the identity. |
private String |
name
Deprecated. The name for this identity. |
private PublicKey |
publicKey
Deprecated. The public key for this identity. |
(package private) IdentityScope |
scope
Deprecated. The scope of the identity. |
private static long |
serialVersionUID
Deprecated. use serialVersionUID from JDK 1.1.x for interoperability |
Constructor Summary | |
protected |
Identity()
Deprecated. Constructor for serialization only. |
|
Identity(String name)
Deprecated. Enabled: Constructs an identity with the specified name and no scope. |
|
Identity(String name,
IdentityScope scope)
Deprecated. Enabled: Constructs an identity with the specified name and scope. |
Method Summary | |
void |
addCertificate(Certificate certificate)
Deprecated. Enabled: Adds a certificate for this identity. |
Certificate[] |
certificates()
Deprecated. Enabled: Returns a copy of all the certificates for this identity. |
private static void |
check(String directive)
Deprecated. |
boolean |
equals(Object identity)
Deprecated. Suppressed: Tests for equality between the specified object and this identity. |
(package private) String |
fullName()
Deprecated. Returns a parsable name for identity: identityName.scopeName |
String |
getInfo()
Deprecated. Enabled: Returns general information previously specified for this identity. |
String |
getName()
Deprecated. Enabled: Returns this identity's name. |
PublicKey |
getPublicKey()
Deprecated. Enabled: Returns this identity's public key. |
IdentityScope |
getScope()
Deprecated. Enabled: Returns this identity's scope. |
int |
hashCode()
Deprecated. Suppressed: Returns a hashcode for this identity. |
protected boolean |
identityEquals(Identity identity)
Deprecated. Tests for equality between the specified identity and this identity. |
private boolean |
keyEquals(Key aKey,
Key anotherKey)
Deprecated. |
(package private) String |
printCertificates()
Deprecated. |
(package private) String |
printKeys()
Deprecated. |
void |
removeCertificate(Certificate certificate)
Deprecated. Enabled: Removes a certificate from this identity. |
void |
setInfo(String info)
Deprecated. Enabled: Specifies a general information string for this identity. |
void |
setPublicKey(PublicKey key)
Deprecated. Enabled: Sets this identity's public key. |
String |
toString()
Deprecated. Suppressed: Returns a short string describing this identity, telling its name and its scope (if any). |
String |
toString(boolean detailed)
Deprecated. Enabled: Returns a string representation of this identity, with optionally more details than that provided by the toString method without any arguments. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
private static final long serialVersionUID
private String name
private PublicKey publicKey
String info
IdentityScope scope
Vector certificates
Constructor Detail |
protected Identity()
public Identity(String name, IdentityScope scope) throws KeyManagementException
name
- the identity name.scope
- the scope of the identity.public Identity(String name)
name
- the identity name.Method Detail |
public final String getName()
getName
in interface Principal
public final IdentityScope getScope()
public PublicKey getPublicKey()
setPublicKey(java.security.PublicKey)
public void setPublicKey(PublicKey key) throws KeyManagementException
First, if there is a security manager, its checkSecurityAccess
method is called with "setIdentityPublicKey"
as its argument to see if it's ok to set the public key.
key
- the public key for this identity.
KeyManagementException
getPublicKey()
,
SecurityManager.checkSecurityAccess(java.lang.String)
public void setInfo(String info)
First, if there is a security manager, its checkSecurityAccess
method is called with "setIdentityInfo"
as its argument to see if it's ok to specify the information string.
info
- the information string.getInfo()
,
SecurityManager.checkSecurityAccess(java.lang.String)
public String getInfo()
setInfo(java.lang.String)
public void addCertificate(Certificate certificate) throws KeyManagementException
First, if there is a security manager, its checkSecurityAccess
method is called with "addIdentityCertificate"
as its argument to see if it's ok to add a certificate.
certificate
- the certificate to be added.
KeyManagementException
SecurityManager.checkSecurityAccess(java.lang.String)
private boolean keyEquals(Key aKey, Key anotherKey)
public void removeCertificate(Certificate certificate) throws KeyManagementException
First, if there is a security manager, its checkSecurityAccess
method is called with "removeIdentityCertificate"
as its argument to see if it's ok to remove a certificate.
certificate
- the certificate to be removed.
KeyManagementException
SecurityManager.checkSecurityAccess(java.lang.String)
public Certificate[] certificates()
public final boolean equals(Object identity)
identityEquals
, which subclasses should
override.
equals
in interface Principal
equals
in class Object
identity
- the object to test for equality with this identity.
identityEquals(java.security.Identity)
protected boolean identityEquals(Identity identity)
identity
- the identity to test for equality with this identity.
equals(java.lang.Object)
String fullName()
public String toString()
First, if there is a security manager, its checkSecurityAccess
method is called with "printIdentity"
as its argument to see if it's ok to return the string.
toString
in interface Principal
toString
in class Object
SecurityManager.checkSecurityAccess(java.lang.String)
public String toString(boolean detailed)
toString
method without any arguments.
First, if there is a security manager, its checkSecurityAccess
method is called with "printIdentity"
as its argument to see if it's ok to return the string.
detailed
- whether or not to provide detailed information.
detailed
is true, then this method returns more information than that
provided by the toString
method without any arguments.toString()
,
SecurityManager.checkSecurityAccess(java.lang.String)
String printKeys()
String printCertificates()
public int hashCode()
hashCode
in interface Principal
hashCode
in class Object
private static void check(String directive)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |