Android APIs
public abstract class

IdentityScope

extends Identity
java.lang.Object
   ↳ java.security.Identity
     ↳ java.security.IdentityScope

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

Class Overview

IdentityScope represents a scope for Identity objects.

Summary

Public Constructors
IdentityScope(String name)
Constructs a new instance of IdentityScope with the specified name.
IdentityScope(String name, IdentityScope scope)
Constructs a new instance of IdentityScope with the specified name and the specified scope.
Protected Constructors
IdentityScope()
Constructs a new instance of IdentityScope.
Public Methods
abstract void addIdentity(Identity identity)
Adds an Identity to this IdentityScope.
abstract Identity getIdentity(String name)
Returns the Identity with the specified name or null if no Identity with the specified name is present in this scope.
abstract Identity getIdentity(PublicKey key)
Returns the Identity which is associated with the specified key or null if no Identity associated with the specified key is present in this scope.
Identity getIdentity(Principal principal)
Returns the Identity with the name of the specified principal or null if no Identity with the name of the specified principal is present in this scope.
static IdentityScope getSystemScope()
Returns the system's scope.
abstract Enumeration<Identity> identities()
Returns an Enumeration over the Identity objects in this IdentityScope.
abstract void removeIdentity(Identity identity)
Removes an Identity from this IdentityScope.
abstract int size()
Returns the number of Identity objects in this scope.
String toString()
Returns a string containing a concise, human-readable description of this IdentityScope.
Protected Methods
static void setSystemScope(IdentityScope scope)
Sets the system's scope.
[Expand]
Inherited Methods
From class java.security.Identity
From class java.lang.Object
From interface java.security.Principal

Public Constructors

public IdentityScope (String name)

Added in API level 1

Constructs a new instance of IdentityScope with the specified name.

Parameters
name String: the name of this IdentityScope.

public IdentityScope (String name, IdentityScope scope)

Added in API level 1

Constructs a new instance of IdentityScope with the specified name and the specified scope.

Parameters
name String: the name of this IdentityScope.
scope IdentityScope: the scope of this IdentityScope.
Throws
KeyManagementException if an identity with the same key already exists.

Protected Constructors

protected IdentityScope ()

Added in API level 1

Constructs a new instance of IdentityScope.

Public Methods

public abstract void addIdentity (Identity identity)

Added in API level 1

Adds an Identity to this IdentityScope.

Parameters
identity Identity: the Identity to be added.
Throws
KeyManagementException if the specified Identity is invalid or an identity with the same key already exists.

public abstract Identity getIdentity (String name)

Added in API level 1

Returns the Identity with the specified name or null if no Identity with the specified name is present in this scope.

Parameters
name String: the name of the Identity to be returned.
Returns
Identity the Identity with the specified name or null if not present.

public abstract Identity getIdentity (PublicKey key)

Added in API level 1

Returns the Identity which is associated with the specified key or null if no Identity associated with the specified key is present in this scope.

Parameters
key PublicKey: the PublicKey of the Identity to be returned.
Returns
Identity the Identity associated with the specified key or null if not present.

public Identity getIdentity (Principal principal)

Added in API level 1

Returns the Identity with the name of the specified principal or null if no Identity with the name of the specified principal is present in this scope.

Parameters
principal Principal: the Principal whose name is used to lookup the Identity to be returned.
Returns
Identity the Identity with the specified name or null if not present.

public static IdentityScope getSystemScope ()

Added in API level 1

Returns the system's scope.

Returns
IdentityScope the system's scope.

public abstract Enumeration<Identity> identities ()

Added in API level 1

Returns an Enumeration over the Identity objects in this IdentityScope.

Returns
Enumeration<Identity> an Enumeration over the Identity objects in this IdentityScope.

public abstract void removeIdentity (Identity identity)

Added in API level 1

Removes an Identity from this IdentityScope.

Parameters
identity Identity: the Identity to be removed.
Throws
KeyManagementException if the Identity is not present in this scope.

public abstract int size ()

Added in API level 1

Returns the number of Identity objects in this scope.

Returns
int the number of Identity objects in this scope.

public String toString ()

Added in API level 1

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

Returns
String a printable representation for this IdentityScope.

Protected Methods

protected static void setSystemScope (IdentityScope scope)

Added in API level 1

Sets the system's scope.

Parameters
scope IdentityScope: the scope to set.