Skip to content

Most visited

Recently visited

navigation
Added in API level 1
Deprecated since API level 1

Identity

public abstract class Identity
extends Object implements Principal, Serializable

java.lang.Object
   ↳ java.security.Identity
Known Direct Subclasses


This class was deprecated in API level 1.
Use Principal, KeyStore and the java.security.cert package instead.

Identity represents an identity like a person or a company.

Summary

Public constructors

Identity(String name)

Creates a new instance of Identity with the specified name.

Identity(String name, IdentityScope scope)

Creates a new instance of Identity with the specified name and the scope of this Identity.

Protected constructors

Identity()

Constructs a new instance of Identity.

Public methods

void addCertificate(Certificate certificate)

Adds a Certificate to this Identity.

Certificate[] certificates()

Returns the certificates for this Identity.

final boolean equals(Object obj)

Compares the specified object with this Identity for equality and returns true if the specified object is equal, false otherwise.

String getInfo()

Returns the information string of this Identity.

final String getName()

Returns the name of this Identity.

PublicKey getPublicKey()

Returns the PublicKey associated with this Identity.

final IdentityScope getScope()

Returns the IdentityScope of this Identity.

int hashCode()

Returns the hash code value for this Identity.

void removeCertificate(Certificate certificate)

Removes the specified Certificate from this Identity.

void setInfo(String info)

Sets an information string for this Identity.

void setPublicKey(PublicKey key)

Sets the specified PublicKey to this Identity.

String toString(boolean detailed)

Returns a string containing a concise, human-readable description of the this Identity.

String toString()

Returns a string containing a concise, human-readable description of the this Identity including its name and its scope.

Protected methods

boolean identityEquals(Identity identity)

Compares the specified Identity with this Identity for equality and returns true if the specified object is equal, false otherwise.

Inherited methods

From class java.lang.Object
From interface java.security.Principal

Public constructors

Identity

Added in API level 1
Identity (String name)

Creates a new instance of Identity with the specified name.

Parameters
name String: the name of this Identity.

Identity

Added in API level 1
Identity (String name, 
                IdentityScope scope)

Creates a new instance of Identity with the specified name and the scope of this Identity.

Parameters
name String: the name of this Identity.
scope IdentityScope: the IdentityScope of this Identity.
Throws
KeyManagementException if an Identity with the same name is already present in the specified scope.

Protected constructors

Identity

Added in API level 1
Identity ()

Constructs a new instance of Identity.

Public methods

addCertificate

Added in API level 1
void addCertificate (Certificate certificate)

Adds a Certificate to this Identity.

Parameters
certificate Certificate: the Certificate to be added to this Identity.
Throws
KeyManagementException if the certificate is not valid.

certificates

Added in API level 1
Certificate[] certificates ()

Returns the certificates for this Identity. External modifications of the returned array has no impact on this Identity.

Returns
Certificate[] the Certificates for this Identity

equals

Added in API level 1
boolean equals (Object obj)

Compares the specified object with this Identity for equality and returns true if the specified object is equal, false otherwise. Identity objects are considered equal, if they have the same name and are in the same scope.

Parameters
obj Object: object to be compared for equality with this Identity.
Returns
boolean true if the specified object is equal to this Identity, otherwise false.

getInfo

Added in API level 1
String getInfo ()

Returns the information string of this Identity.

Returns
String the information string of this Identity.

getName

Added in API level 1
String getName ()

Returns the name of this Identity.

Returns
String the name of this Identity.

getPublicKey

Added in API level 1
PublicKey getPublicKey ()

Returns the PublicKey associated with this Identity.

Returns
PublicKey the PublicKey associated with this Identity.

getScope

Added in API level 1
IdentityScope getScope ()

Returns the IdentityScope of this Identity.

Returns
IdentityScope the IdentityScope of this Identity.

hashCode

Added in API level 1
int hashCode ()

Returns the hash code value for this Identity. Returns the same hash code for Identitys that are equal to each other as required by the general contract of hashCode().

Returns
int the hash code value for this Identity.

See also:

removeCertificate

Added in API level 1
void removeCertificate (Certificate certificate)

Removes the specified Certificate from this Identity.

Parameters
certificate Certificate: the Certificate to be removed.
Throws
KeyManagementException if the certificate is not found.

setInfo

Added in API level 1
void setInfo (String info)

Sets an information string for this Identity.

Parameters
info String: the information to be set.

setPublicKey

Added in API level 1
void setPublicKey (PublicKey key)

Sets the specified PublicKey to this Identity.

Parameters
key PublicKey: the PublicKey to be set.
Throws
KeyManagementException if another Identity in the same scope as this Identity already has the same PublicKey.

toString

Added in API level 1
String toString (boolean detailed)

Returns a string containing a concise, human-readable description of the this Identity.

Parameters
detailed boolean: whether or not this method should return detailed information.
Returns
String a printable representation for this Permission.

toString

Added in API level 1
String toString ()

Returns a string containing a concise, human-readable description of the this Identity including its name and its scope.

Returns
String a printable representation for this Identity.

Protected methods

identityEquals

Added in API level 1
boolean identityEquals (Identity identity)

Compares the specified Identity with this Identity for equality and returns true if the specified object is equal, false otherwise.

To be equal, two Identity objects need to have the same name and the same public keys.

Parameters
identity Identity: the identity to check for equality.
Returns
boolean true if the Identity objects are equal, false otherwise.
This site uses cookies to store your preferences for site-specific language and display options.

Hooray!

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.