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 Identity and can have a name
and scope along with the other qualitites identities possess.
An IdentityScope
contains other Identity objects.
All 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 IdentityScope.
|
Method Summary | |
---|---|
abstract void | addIdentity(Identity identity)
Adds an identity to his scope.
|
abstract Identity | getIdentity(String name)
Returns the specified Identity, by name, within this scope.
|
Identity | getIdentity(Principal principal) |
abstract Identity | getIdentity(PublicKey key)
Returns the specified Identity, by public key, within this scope.
|
static IdentityScope | getSystemScope()
Returns the system's Scope.
|
abstract Enumeration<Identity> | identities()
Returns an 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 IdentityScope.
Parameters: name the name to use. scope the scope to use.
Throws: KeyManagementException if the identity scope is already present.
Parameters: identity the 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 Identity to get.
Returns: an Identity representing the name or null
if
it cannot be found.
Parameters: principal the Principal to use.
Returns: an identity representing the Principal or null
if it cannot be found.
Parameters: key the PublicKey to use.
Returns: an identity representing the public key or null
if
it cannot be found.
Returns: the system's Scope.
Returns: an Enumeration of the identities in this scope.
Parameters: identity the 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 SecurityManager is installed which disallows this operation.
IdentityScope
.
Returns: the number of entries within this IdentityScope
.
Returns: a string representation of this instance.