java.security
public abstract class IdentityScope extends Identity
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.
Identity
,
Signer
,
Principal
,
Key
,
Serialized FormModifier | Constructor and Description |
---|---|
protected |
IdentityScope()
Deprecated.
Constructor for serialization purposes.
|
|
IdentityScope(String name)
Deprecated.
Constructs a new instance of
IdentityScope with the
specified name and no scope. |
|
IdentityScope(String name,
IdentityScope scope)
Deprecated.
Constructs a new instance of
IdentityScope with the
specified name and IdentityScope . |
Modifier and Type | Method and Description |
---|---|
abstract void |
addIdentity(Identity identity)
Deprecated.
Adds an identity to his scope.
|
Identity |
getIdentity(Principal principal)
Deprecated.
|
abstract Identity |
getIdentity(PublicKey key)
Deprecated.
Returns the specified
Identity , by public key, within this scope. |
abstract Identity |
getIdentity(String name)
Deprecated.
Returns the specified
Identity , by name, within this scope. |
static IdentityScope |
getSystemScope()
Deprecated.
Returns the system's Scope.
|
abstract Enumeration<Identity> |
identities()
Deprecated.
Returns an
Enumeration of identities in this scope. |
abstract void |
removeIdentity(Identity identity)
Deprecated.
Removes an identity in this scope.
|
protected static void |
setSystemScope(IdentityScope scope)
Deprecated.
Sets the scope of the system.
|
abstract int |
size()
Deprecated.
Returns the number of entries within this
IdentityScope . |
String |
toString()
Deprecated.
Returns a string representing this instance.
|
addCertificate, certificates, equals, getInfo, getName, getPublicKey, getScope, hashCode, identityEquals, removeCertificate, setInfo, setPublicKey, toString
protected IdentityScope()
public IdentityScope(String name)
IdentityScope
with the
specified name and no scope.name
- the name to use.public IdentityScope(String name, IdentityScope scope) throws KeyManagementException
IdentityScope
with the
specified name and IdentityScope
.name
- the name to use.scope
- the scope to use.KeyManagementException
- if the identity scope is already present.public static IdentityScope getSystemScope()
protected static void setSystemScope(IdentityScope scope)
scope
- the new system scope.SecurityException
- if a SecurityManager
is installed which disallows this
operation.public abstract int size()
IdentityScope
.IdentityScope
.public abstract Identity getIdentity(String name)
Identity
, by name, within this scope.public Identity getIdentity(Principal principal)
public abstract Identity getIdentity(PublicKey key)
Identity
, by public key, within this scope.key
- the PublicKey
to use.null
if
it cannot be found.public abstract void addIdentity(Identity identity) throws KeyManagementException
identity
- the Identity
to add.KeyManagementException
- if it is an invalid identity, an identity with the same key
exists, or if another error occurs.public abstract void removeIdentity(Identity identity) throws KeyManagementException
identity
- the Identity
to remove.KeyManagementException
- if it is a missing identity, or if another error occurs.public abstract Enumeration<Identity> identities()
Enumeration
of identities in this scope.Enumeration
of the identities in this scope.public String toString()
toString
in interface Principal
toString
in class Identity
Object.getClass()
,
Object.hashCode()
,
Class.getName()
,
Integer.toHexString(int)