java.security
Class IdentityScope

java.lang.Object
  |
  +--java.security.Identity
        |
        +--java.security.IdentityScope
All Implemented Interfaces:
Principal, Serializable

public abstract class IdentityScope
extends Identity

Untamed:

See Also:
Serialized Form

Field Summary
private static IdentityScope scope
           
 
Fields inherited from class java.security.Identity
certificates, info
 
Constructor Summary
protected IdentityScope()
          This constructor is used for serialization only and should not be used by subclasses.
  IdentityScope(String name)
          Enabled: Constructs a new identity scope with the specified name.
  IdentityScope(String name, IdentityScope scope)
          Enabled: Constructs a new identity scope with the specified name and scope.
 
Method Summary
abstract  void addIdentity(Identity identity)
          Enabled: Adds an identity to this identity scope.
private static void check(String directive)
           
 Identity getIdentity(Principal principal)
          Enabled: Retrieves the identity whose name is the same as that of the specified principal.
abstract  Identity getIdentity(PublicKey key)
          Enabled: Retrieves the identity with the specified public key.
abstract  Identity getIdentity(String name)
          Enabled: Returns the identity in this scope with the specified name (if any).
static IdentityScope getSystemScope()
          Enabled: Returns the system's identity scope.
abstract  Enumeration identities()
          Enabled: Returns an enumeration of all identities in this identity scope.
private static void initializeSystemScope()
           
abstract  void removeIdentity(Identity identity)
          Enabled: Removes an identity from this identity scope.
protected static void setSystemScope(IdentityScope scope)
          Sets the system's identity scope.
abstract  int size()
          Enabled: Returns the number of identities within this identity scope.
 String toString()
          Suppressed: Returns a string representation of this identity scope, including its name, its scope name, and the number of identities in this identity scope.
 
Methods inherited from class java.security.Identity
addCertificate, certificates, equals, fullName, getInfo, getName, getPublicKey, getScope, hashCode, identityEquals, printCertificates, printKeys, removeCertificate, setInfo, setPublicKey, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

scope

private static IdentityScope scope
Constructor Detail

IdentityScope

protected IdentityScope()
This constructor is used for serialization only and should not be used by subclasses.


IdentityScope

public IdentityScope(String name)
Enabled: Constructs a new identity scope with the specified name.

Parameters:
name - the scope name.

IdentityScope

public IdentityScope(String name,
                     IdentityScope scope)
              throws KeyManagementException
Enabled: Constructs a new identity scope with the specified name and scope.

Parameters:
name - the scope name.
scope - the scope for the new identity scope.
Method Detail

initializeSystemScope

private static void initializeSystemScope()

getSystemScope

public static IdentityScope getSystemScope()
Enabled: Returns the system's identity scope.

Returns:
the system's identity scope.
See Also:
setSystemScope(java.security.IdentityScope)

setSystemScope

protected static void setSystemScope(IdentityScope scope)
Sets the system's identity scope.

First, if there is a security manager, its checkSecurityAccess method is called with "setSystemScope" as its argument to see if it's ok to set the identity scope.

Parameters:
scope - the scope to set.
See Also:
getSystemScope(), SecurityManager.checkSecurityAccess(java.lang.String)

size

public abstract int size()
Enabled: Returns the number of identities within this identity scope.

Returns:
the number of identities within this identity scope.

getIdentity

public abstract Identity getIdentity(String name)
Enabled: Returns the identity in this scope with the specified name (if any).

Parameters:
name - the name of the identity to be retrieved.
Returns:
the identity named name, or null if there are no identities named name in this scope.

getIdentity

public Identity getIdentity(Principal principal)
Enabled: Retrieves the identity whose name is the same as that of the specified principal. (Note: Identity implements Principal.)

Parameters:
principal - the principal corresponding to the identity to be retrieved.
Returns:
the identity whose name is the same as that of the principal, or null if there are no identities of the same name in this scope.

getIdentity

public abstract Identity getIdentity(PublicKey key)
Enabled: Retrieves the identity with the specified public key.

Parameters:
key - the public key for the identity to be returned.
Returns:
the identity with the given key, or null if there are no identities in this scope with that key.

addIdentity

public abstract void addIdentity(Identity identity)
                          throws KeyManagementException
Enabled: Adds an identity to this identity scope.

Parameters:
identity - the identity to be added.
KeyManagementException

removeIdentity

public abstract void removeIdentity(Identity identity)
                             throws KeyManagementException
Enabled: Removes an identity from this identity scope.

Parameters:
identity - the identity to be removed.
KeyManagementException

identities

public abstract Enumeration identities()
Enabled: Returns an enumeration of all identities in this identity scope.

Returns:
an enumeration of all identities in this identity scope.

toString

public String toString()
Suppressed: Returns a string representation of this identity scope, including its name, its scope name, and the number of identities in this identity scope.

Specified by:
toString in interface Principal
Overrides:
toString in class Identity
Returns:
a string representation of this identity scope.
See Also:
SecurityManager.checkSecurityAccess(java.lang.String)

check

private static void check(String directive)


comments?