java.security
public abstract class IdentityScope extends Identity
Deprecated: Use java.security.KeyStore, the java.security.cert package, and java.security.Principal.
IdentityScope
represents a scope of an identity.
IdentityScope
is also an {@link Identity} and can have a name
and scope along with the other qualitites identities possess.
An IdentityScope
contains other {@link Identity} objects.
All {@link Identity} objects are manipulated in the scope the same way. The
scope is supposed to apply different scope to different type of
Identities.
No identity within the same scope can have the same public key.
Constructor Summary | |
---|---|
protected | IdentityScope() Constructor for serialization purposes. |
IdentityScope(String name)
Constructs a new instance of IdentityScope with the
specified name and no scope.
| |
IdentityScope(String name, IdentityScope scope)
Constructs a new instance of IdentityScope with the
specified name and {@link IdentityScope}.
|
Method Summary | |
---|---|
abstract void | addIdentity(Identity identity)
Adds an identity to his scope.
|
abstract Identity | getIdentity(String name)
Returns the specified {@link Identity}, by name, within this scope.
|
Identity | getIdentity(Principal principal)
Returns the specified {@link Identity}, by {@link Principal}, within this
scope.
|
abstract Identity | getIdentity(PublicKey key)
Returns the specified {@link Identity}, by public key, within this scope.
|
static IdentityScope | getSystemScope()
Returns the system's Scope.
|
abstract Enumeration<Identity> | identities()
Returns an {@link Enumeration} of identities in this scope.
|
abstract void | removeIdentity(Identity identity)
Removes an identity in this scope.
|
protected static void | setSystemScope(IdentityScope scope)
Sets the scope of the system.
|
abstract int | size()
Returns the number of entries within this IdentityScope .
|
String | toString()
Returns a string representing this instance. |
IdentityScope
with the
specified name and no scope.
Parameters: name the name to use.
IdentityScope
with the
specified name and {@link IdentityScope}.
Parameters: name the name to use. scope the scope to use.
Throws: KeyManagementException if the identity scope is already present.
Parameters: identity the {@link Identity} to add.
Throws: KeyManagementException if it is an invalid identity, an identity with the same key exists, or if another error occurs.
Parameters: name name of {@link Identity} to get.
Returns: an {@link Identity} representing the name or null
if
it cannot be found.
Parameters: principal the {@link Principal} to use.
Returns: an identity representing the {@link Principal} or null
if it cannot be found.
Parameters: key the {@link PublicKey} to use.
Returns: an identity representing the public key or null
if
it cannot be found.
Returns: the system's Scope.
Returns: an {@link Enumeration} of the identities in this scope.
Parameters: identity the {@link Identity} to remove.
Throws: KeyManagementException if it is a missing identity, or if another error occurs.
Parameters: scope the new system scope.
Throws: SecurityException if a {@link SecurityManager} is installed which disallows this operation.
IdentityScope
.
Returns: the number of entries within this IdentityScope
.
Returns: a string representation of this instance.