Skip to content

Most visited

Recently visited

navigation
Added in API level 1
Deprecated since API level 1

IdentityScope

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.

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.

Inherited methods

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

Public constructors

IdentityScope

Added in API level 1
IdentityScope (String name)

Constructs a new instance of IdentityScope with the specified name.

Parameters
name String: the name of this IdentityScope.

IdentityScope

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

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

IdentityScope

Added in API level 1
IdentityScope ()

Constructs a new instance of IdentityScope.

Public methods

addIdentity

Added in API level 1
void addIdentity (Identity identity)

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.

getIdentity

Added in API level 1
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.

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

getIdentity

Added in API level 1
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.

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.

getIdentity

Added in API level 1
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.

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.

getSystemScope

Added in API level 1
IdentityScope getSystemScope ()

Returns the system's scope.

Returns
IdentityScope the system's scope.

identities

Added in API level 1
Enumeration<Identity> identities ()

Returns an Enumeration over the Identity objects in this IdentityScope.

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

removeIdentity

Added in API level 1
void removeIdentity (Identity identity)

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.

size

Added in API level 1
int size ()

Returns the number of Identity objects in this scope.

Returns
int the number of Identity objects in this scope.

toString

Added in API level 1
String toString ()

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

Returns
String a printable representation for this IdentityScope.

Protected methods

setSystemScope

Added in API level 1
void setSystemScope (IdentityScope scope)

Sets the system's scope.

Parameters
scope IdentityScope: the scope to set.
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.