* #### Identity
protected Identity()
Deprecated.
Constructor for serialization only.
* #### Identity
public Identity([String](../../java/lang/String.html "class in java.lang") name,
[IdentityScope](../../java/security/IdentityScope.html "class in java.security") scope)
throws [KeyManagementException](../../java/security/KeyManagementException.html "class in java.security")
Deprecated.
Constructs an identity with the specified name and scope.
Parameters:
`name` \- the identity name.
`scope` \- the scope of the identity.
Throws:
`[KeyManagementException](../../java/security/KeyManagementException.html "class in java.security")` \- if there is already an identity with the same name in the scope.
* #### Identity
public Identity([String](../../java/lang/String.html "class in java.lang") name)
Deprecated.
Constructs an identity with the specified name and no scope.
Parameters:
`name` \- the identity name.
Method Detail
* #### getName
public final [String](../../java/lang/String.html "class in java.lang") getName()
Deprecated.
Returns this identity's name.
Specified by:
`[getName](../../java/security/Principal.html#getName--)` in interface `[Principal](../../java/security/Principal.html "interface in java.security")`
Returns:
the name of this identity.
* #### getScope
public final [IdentityScope](../../java/security/IdentityScope.html "class in java.security") getScope()
Deprecated.
Returns this identity's scope.
Returns:
the scope of this identity.
* #### getPublicKey
public [PublicKey](../../java/security/PublicKey.html "interface in java.security") getPublicKey()
Deprecated.
Returns this identity's public key.
Returns:
the public key for this identity.
See Also:
[setPublicKey(java.security.PublicKey)](../../java/security/Identity.html#setPublicKey-java.security.PublicKey-)
* #### setPublicKey
public void setPublicKey([PublicKey](../../java/security/PublicKey.html "interface in java.security") key)
throws [KeyManagementException](../../java/security/KeyManagementException.html "class in java.security")
Deprecated.
Sets this identity's public key. The old key and all of this identity's certificates are removed by this operation.
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.
Parameters:
`key` \- the public key for this identity.
Throws:
`[KeyManagementException](../../java/security/KeyManagementException.html "class in java.security")` \- if another identity in the identity's scope has the same public key, or if another exception occurs.
`[SecurityException](../../java/lang/SecurityException.html "class in java.lang")` \- if a security manager exists and its`checkSecurityAccess` method doesn't allow setting the public key.
See Also:
[getPublicKey()](../../java/security/Identity.html#getPublicKey--), [SecurityManager.checkSecurityAccess(java.lang.String)](../../java/lang/SecurityManager.html#checkSecurityAccess-java.lang.String-)
* #### setInfo
public void setInfo([String](../../java/lang/String.html "class in java.lang") info)
Deprecated.
Specifies a general information string for this identity.
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.
Parameters:
`info` \- the information string.
Throws:
`[SecurityException](../../java/lang/SecurityException.html "class in java.lang")` \- if a security manager exists and its`checkSecurityAccess` method doesn't allow setting the information string.
See Also:
[getInfo()](../../java/security/Identity.html#getInfo--), [SecurityManager.checkSecurityAccess(java.lang.String)](../../java/lang/SecurityManager.html#checkSecurityAccess-java.lang.String-)
* #### getInfo
public [String](../../java/lang/String.html "class in java.lang") getInfo()
Deprecated.
Returns general information previously specified for this identity.
Returns:
general information about this identity.
See Also:
[setInfo(java.lang.String)](../../java/security/Identity.html#setInfo-java.lang.String-)
* #### addCertificate
public void addCertificate([Certificate](../../java/security/Certificate.html "interface in java.security") certificate)
throws [KeyManagementException](../../java/security/KeyManagementException.html "class in java.security")
Deprecated.
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.
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.
Parameters:
`certificate` \- the certificate to be added.
Throws:
`[KeyManagementException](../../java/security/KeyManagementException.html "class in java.security")` \- 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.
`[SecurityException](../../java/lang/SecurityException.html "class in java.lang")` \- if a security manager exists and its`checkSecurityAccess` method doesn't allow adding a certificate.
See Also:
[SecurityManager.checkSecurityAccess(java.lang.String)](../../java/lang/SecurityManager.html#checkSecurityAccess-java.lang.String-)
* #### removeCertificate
public void removeCertificate([Certificate](../../java/security/Certificate.html "interface in java.security") certificate)
throws [KeyManagementException](../../java/security/KeyManagementException.html "class in java.security")
Deprecated.
Removes a certificate from this identity.
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.
Parameters:
`certificate` \- the certificate to be removed.
Throws:
`[KeyManagementException](../../java/security/KeyManagementException.html "class in java.security")` \- if the certificate is missing, or if another exception occurs.
`[SecurityException](../../java/lang/SecurityException.html "class in java.lang")` \- if a security manager exists and its`checkSecurityAccess` method doesn't allow removing a certificate.
See Also:
[SecurityManager.checkSecurityAccess(java.lang.String)](../../java/lang/SecurityManager.html#checkSecurityAccess-java.lang.String-)
* #### certificates
public [Certificate](../../java/security/Certificate.html "interface in java.security")[] certificates()
Deprecated.
Returns a copy of all the certificates for this identity.
Returns:
a copy of all the certificates for this identity.
* #### equals
public final boolean equals([Object](../../java/lang/Object.html "class in java.lang") identity)
Deprecated.
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[identityEquals](../../java/security/Identity.html#identityEquals-java.security.Identity-), which subclasses should override.
Specified by:
`[equals](../../java/security/Principal.html#equals-java.lang.Object-)` in interface `[Principal](../../java/security/Principal.html "interface in java.security")`
Overrides:
`[equals](../../java/lang/Object.html#equals-java.lang.Object-)` in class `[Object](../../java/lang/Object.html "class in java.lang")`
Parameters:
`identity` \- the object to test for equality with this identity.
Returns:
true if the objects are considered equal, false otherwise.
See Also:
[identityEquals(java.security.Identity)](../../java/security/Identity.html#identityEquals-java.security.Identity-)
* #### identityEquals
protected boolean identityEquals([Identity](../../java/security/Identity.html "class in java.security") identity)
Deprecated.
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.
Parameters:
`identity` \- the identity to test for equality with this identity.
Returns:
true if the identities are considered equal, false otherwise.
See Also:
[equals(java.lang.Object)](../../java/security/Identity.html#equals-java.lang.Object-)
* #### toString
public [String](../../java/lang/String.html "class in java.lang") toString()
Deprecated.
Returns a short string describing this identity, telling its name and its scope (if any).
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.
Specified by:
`[toString](../../java/security/Principal.html#toString--)` in interface `[Principal](../../java/security/Principal.html "interface in java.security")`
Overrides:
`[toString](../../java/lang/Object.html#toString--)` in class `[Object](../../java/lang/Object.html "class in java.lang")`
Returns:
information about this identity, such as its name and the name of its scope (if any).
Throws:
`[SecurityException](../../java/lang/SecurityException.html "class in java.lang")` \- if a security manager exists and its`checkSecurityAccess` method doesn't allow returning a string describing this identity.
See Also:
[SecurityManager.checkSecurityAccess(java.lang.String)](../../java/lang/SecurityManager.html#checkSecurityAccess-java.lang.String-)
* #### toString
public [String](../../java/lang/String.html "class in java.lang") toString(boolean detailed)
Deprecated.
Returns a string representation of this identity, with optionally more details than that provided by the`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.
Parameters:
`detailed` \- whether or not to provide detailed information.
Returns:
information about this identity. If `detailed` is true, then this method returns more information than that provided by the `toString` method without any arguments.
Throws:
`[SecurityException](../../java/lang/SecurityException.html "class in java.lang")` \- if a security manager exists and its`checkSecurityAccess` method doesn't allow returning a string describing this identity.
See Also:
[toString()](../../java/security/Identity.html#toString--), [SecurityManager.checkSecurityAccess(java.lang.String)](../../java/lang/SecurityManager.html#checkSecurityAccess-java.lang.String-)
* #### hashCode
public int hashCode()
Deprecated.
Returns a hashcode for this identity.
Specified by:
`[hashCode](../../java/security/Principal.html#hashCode--)` in interface `[Principal](../../java/security/Principal.html "interface in java.security")`
Overrides:
`[hashCode](../../java/lang/Object.html#hashCode--)` in class `[Object](../../java/lang/Object.html "class in java.lang")`
Returns:
a hashcode for this identity.
See Also:
[Object.equals(java.lang.Object)](../../java/lang/Object.html#equals-java.lang.Object-), [System.identityHashCode(java.lang.Object)](../../java/lang/System.html#identityHashCode-java.lang.Object-)