public abstract class

IdentityScope

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

This class is deprecated.The functionality of this class has been replace by Principal, KeyStore and the java.security.cert package.

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(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.
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.
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)

Constructs a new instance of IdentityScope with the specified name.

Parameters
name the name of this IdentityScope.

public IdentityScope (String name, IdentityScope scope)

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

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

Protected Constructors

protected IdentityScope ()

Constructs a new instance of IdentityScope.

Public Methods

public abstract void addIdentity (Identity identity)

Adds an Identity to this IdentityScope.

Parameters
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 (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 the PublicKey of the Identity to be returned.
Returns
  • the Identity associated with the specified key or null if not present.

public 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 the Principal whose name is used to lookup the Identity to be returned.
Returns
  • the Identity with the specified name or null if not present.

public 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.

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

public static IdentityScope getSystemScope ()

Returns the system's scope.

Returns
  • the system's scope.

public abstract Enumeration<Identity> identities ()

Returns an Enumeration over the Identity objects in this IdentityScope.

Returns
  • an Enumeration over the Identity objects in this IdentityScope.

public abstract void removeIdentity (Identity identity)

Removes an Identity from this IdentityScope.

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

public abstract int size ()

Returns the number of Identity objects in this scope.

Returns
  • the number of Identity objects in this scope.

public String toString ()

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

Returns
  • a printable representation for this IdentityScope.

Protected Methods

protected static void setSystemScope (IdentityScope scope)

Sets the system's scope.

Parameters
scope the scope to set.