java.security
Class IdentityScope

java.lang.Object sample code for java.lang.Object definition code for java.lang.Object 
  extended by java.security.Identity sample code for java.security.Identity definition code for java.security.Identity 
      extended by java.security.IdentityScope
All Implemented Interfaces:
Serializable sample code for java.io.Serializable definition code for java.io.Serializable , Principal sample code for java.security.Principal definition code for java.security.Principal

Deprecated. This class is no longer used. Its functionality has been replaced by java.security.KeyStore, the java.security.cert package, and java.security.Principal.

@Deprecated
public abstract class IdentityScope
extends Identity sample code for java.security.Identity definition code for java.security.Identity

This class represents a scope for identities. It is an Identity itself, and therefore has a name and can have a scope. It can also optionally have a public key and associated certificates.

An IdentityScope can contain Identity objects of all kinds, including Signers. All types of Identity objects can be retrieved, added, and removed using the same methods. Note that it is possible, and in fact expected, that different types of identity scopes will apply different policies for their various operations on the various types of Identities.

There is a one-to-one mapping between keys and identities, and there can only be one copy of one key per scope. For example, suppose Acme Software, Inc is a software publisher known to a user. Suppose it is an Identity, that is, it has a public key, and a set of associated certificates. It is named in the scope using the name "Acme Software". No other named Identity in the scope has the same public key. Of course, none has the same name as well.

See Also:
Identity sample code for java.security.Identity definition code for java.security.Identity , Signer sample code for java.security.Signer definition code for java.security.Signer , Principal sample code for java.security.Principal definition code for java.security.Principal , Key sample code for java.security.Key definition code for java.security.Key , Serialized Form

Constructor Summary
protected IdentityScope sample code for java.security.IdentityScope.IdentityScope() definition code for java.security.IdentityScope.IdentityScope() ()
          Deprecated. This constructor is used for serialization only and should not be used by subclasses.
  IdentityScope sample code for java.security.IdentityScope.IdentityScope(java.lang.String) definition code for java.security.IdentityScope.IdentityScope(java.lang.String) (String sample code for java.lang.String definition code for java.lang.String  name)
          Deprecated. Constructs a new identity scope with the specified name.
  IdentityScope sample code for java.security.IdentityScope.IdentityScope(java.lang.String, java.security.IdentityScope) definition code for java.security.IdentityScope.IdentityScope(java.lang.String, java.security.IdentityScope) (String sample code for java.lang.String definition code for java.lang.String  name, IdentityScope sample code for java.security.IdentityScope definition code for java.security.IdentityScope  scope)
          Deprecated. Constructs a new identity scope with the specified name and scope.
 
Method Summary
abstract  void addIdentity sample code for java.security.IdentityScope.addIdentity(java.security.Identity) definition code for java.security.IdentityScope.addIdentity(java.security.Identity) (Identity sample code for java.security.Identity definition code for java.security.Identity  identity)
          Deprecated. Adds an identity to this identity scope.
 Identity sample code for java.security.Identity definition code for java.security.Identity getIdentity sample code for java.security.IdentityScope.getIdentity(java.security.Principal) definition code for java.security.IdentityScope.getIdentity(java.security.Principal) (Principal sample code for java.security.Principal definition code for java.security.Principal  principal)
          Deprecated. Retrieves the identity whose name is the same as that of the specified principal.
abstract  Identity sample code for java.security.Identity definition code for java.security.Identity getIdentity sample code for java.security.IdentityScope.getIdentity(java.security.PublicKey) definition code for java.security.IdentityScope.getIdentity(java.security.PublicKey) (PublicKey sample code for java.security.PublicKey definition code for java.security.PublicKey  key)
          Deprecated. Retrieves the identity with the specified public key.
abstract  Identity sample code for java.security.Identity definition code for java.security.Identity getIdentity sample code for java.security.IdentityScope.getIdentity(java.lang.String) definition code for java.security.IdentityScope.getIdentity(java.lang.String) (String sample code for java.lang.String definition code for java.lang.String  name)
          Deprecated. Returns the identity in this scope with the specified name (if any).
static IdentityScope sample code for java.security.IdentityScope definition code for java.security.IdentityScope getSystemScope sample code for java.security.IdentityScope.getSystemScope() definition code for java.security.IdentityScope.getSystemScope() ()
          Deprecated. Returns the system's identity scope.
abstract  Enumeration sample code for java.util.Enumeration definition code for java.util.Enumeration <Identity sample code for java.security.Identity definition code for java.security.Identity > identities sample code for java.security.IdentityScope.identities() definition code for java.security.IdentityScope.identities() ()
          Deprecated. Returns an enumeration of all identities in this identity scope.
abstract  void removeIdentity sample code for java.security.IdentityScope.removeIdentity(java.security.Identity) definition code for java.security.IdentityScope.removeIdentity(java.security.Identity) (Identity sample code for java.security.Identity definition code for java.security.Identity  identity)
          Deprecated. Removes an identity from this identity scope.
protected static void setSystemScope sample code for java.security.IdentityScope.setSystemScope(java.security.IdentityScope) definition code for java.security.IdentityScope.setSystemScope(java.security.IdentityScope) (IdentityScope sample code for java.security.IdentityScope definition code for java.security.IdentityScope  scope)
          Deprecated. Sets the system's identity scope.
abstract  int size sample code for java.security.IdentityScope.size() definition code for java.security.IdentityScope.size() ()
          Deprecated. Returns the number of identities within this identity scope.
 String sample code for java.lang.String definition code for java.lang.String toString sample code for java.security.IdentityScope.toString() definition code for java.security.IdentityScope.toString() ()
          Deprecated. 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 sample code for java.security.Identity definition code for java.security.Identity
addCertificate sample code for java.security.Identity.addCertificate(java.security.Certificate) definition code for java.security.Identity.addCertificate(java.security.Certificate) , certificates sample code for java.security.Identity.certificates() definition code for java.security.Identity.certificates() , equals sample code for java.security.Identity.equals(java.lang.Object) definition code for java.security.Identity.equals(java.lang.Object) , getInfo sample code for java.security.Identity.getInfo() definition code for java.security.Identity.getInfo() , getName sample code for java.security.Identity.getName() definition code for java.security.Identity.getName() , getPublicKey sample code for java.security.Identity.getPublicKey() definition code for java.security.Identity.getPublicKey() , getScope sample code for java.security.Identity.getScope() definition code for java.security.Identity.getScope() , hashCode sample code for java.security.Identity.hashCode() definition code for java.security.Identity.hashCode() , identityEquals sample code for java.security.Identity.identityEquals(java.security.Identity) definition code for java.security.Identity.identityEquals(java.security.Identity) , removeCertificate sample code for java.security.Identity.removeCertificate(java.security.Certificate) definition code for java.security.Identity.removeCertificate(java.security.Certificate) , setInfo sample code for java.security.Identity.setInfo(java.lang.String) definition code for java.security.Identity.setInfo(java.lang.String) , setPublicKey sample code for java.security.Identity.setPublicKey(java.security.PublicKey) definition code for java.security.Identity.setPublicKey(java.security.PublicKey) , toString sample code for java.security.Identity.toString(boolean) definition code for java.security.Identity.toString(boolean)
 
Methods inherited from class java.lang.Object sample code for java.lang.Object definition code for java.lang.Object
clone sample code for java.lang.Object.clone() definition code for java.lang.Object.clone() , finalize sample code for java.lang.Object.finalize() definition code for java.lang.Object.finalize() , getClass sample code for java.lang.Object.getClass() definition code for java.lang.Object.getClass() , notify sample code for java.lang.Object.notify() definition code for java.lang.Object.notify() , notifyAll sample code for java.lang.Object.notifyAll() definition code for java.lang.Object.notifyAll() , wait sample code for java.lang.Object.wait() definition code for java.lang.Object.wait() , wait sample code for java.lang.Object.wait(long) definition code for java.lang.Object.wait(long) , wait sample code for java.lang.Object.wait(long, int) definition code for java.lang.Object.wait(long, int)
 

Constructor Detail

IdentityScope sample code for java.security.IdentityScope() definition code for java.security.IdentityScope()

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


IdentityScope sample code for java.security.IdentityScope(java.lang.String) definition code for java.security.IdentityScope(java.lang.String)

public IdentityScope(String sample code for java.lang.String definition code for java.lang.String  name)
Deprecated. 
Constructs a new identity scope with the specified name.

Parameters:
name - the scope name.

IdentityScope sample code for java.security.IdentityScope(java.lang.String, java.security.IdentityScope) definition code for java.security.IdentityScope(java.lang.String, java.security.IdentityScope)

public IdentityScope(String sample code for java.lang.String definition code for java.lang.String  name,
                     IdentityScope sample code for java.security.IdentityScope definition code for java.security.IdentityScope  scope)
              throws KeyManagementException sample code for java.security.KeyManagementException definition code for java.security.KeyManagementException 
Deprecated. 
Constructs a new identity scope with the specified name and scope.

Parameters:
name - the scope name.
scope - the scope for the new identity scope.
Throws:
KeyManagementException sample code for java.security.KeyManagementException definition code for java.security.KeyManagementException - if there is already an identity with the same name in the scope.
Method Detail

getSystemScope sample code for java.security.IdentityScope.getSystemScope() definition code for java.security.IdentityScope.getSystemScope()

public static IdentityScope sample code for java.security.IdentityScope definition code for java.security.IdentityScope  getSystemScope()
Deprecated. 
Returns the system's identity scope.

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

setSystemScope sample code for java.security.IdentityScope.setSystemScope(java.security.IdentityScope) definition code for java.security.IdentityScope.setSystemScope(java.security.IdentityScope)

protected static void setSystemScope(IdentityScope sample code for java.security.IdentityScope definition code for java.security.IdentityScope  scope)
Deprecated. 
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.
Throws:
SecurityException sample code for java.lang.SecurityException definition code for java.lang.SecurityException - if a security manager exists and its checkSecurityAccess method doesn't allow setting the identity scope.
See Also:
getSystemScope() sample code for java.security.IdentityScope.getSystemScope() definition code for java.security.IdentityScope.getSystemScope() , SecurityManager.checkSecurityAccess(java.lang.String) sample code for java.lang.SecurityManager.checkSecurityAccess(java.lang.String) definition code for java.lang.SecurityManager.checkSecurityAccess(java.lang.String)

size sample code for java.security.IdentityScope.size() definition code for java.security.IdentityScope.size()

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

Returns:
the number of identities within this identity scope.

getIdentity sample code for java.security.IdentityScope.getIdentity(java.lang.String) definition code for java.security.IdentityScope.getIdentity(java.lang.String)

public abstract Identity sample code for java.security.Identity definition code for java.security.Identity  getIdentity(String sample code for java.lang.String definition code for java.lang.String  name)
Deprecated. 
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 sample code for java.security.IdentityScope.getIdentity(java.security.Principal) definition code for java.security.IdentityScope.getIdentity(java.security.Principal)

public Identity sample code for java.security.Identity definition code for java.security.Identity  getIdentity(Principal sample code for java.security.Principal definition code for java.security.Principal  principal)
Deprecated. 
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 sample code for java.security.IdentityScope.getIdentity(java.security.PublicKey) definition code for java.security.IdentityScope.getIdentity(java.security.PublicKey)

public abstract Identity sample code for java.security.Identity definition code for java.security.Identity  getIdentity(PublicKey sample code for java.security.PublicKey definition code for java.security.PublicKey  key)
Deprecated. 
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 sample code for java.security.IdentityScope.addIdentity(java.security.Identity) definition code for java.security.IdentityScope.addIdentity(java.security.Identity)

public abstract void addIdentity(Identity sample code for java.security.Identity definition code for java.security.Identity  identity)
                          throws KeyManagementException sample code for java.security.KeyManagementException definition code for java.security.KeyManagementException 
Deprecated. 
Adds an identity to this identity scope.

Parameters:
identity - the identity to be added.
Throws:
KeyManagementException sample code for java.security.KeyManagementException definition code for java.security.KeyManagementException - if the identity is not valid, a name conflict occurs, another identity has the same public key as the identity being added, or another exception occurs.

removeIdentity sample code for java.security.IdentityScope.removeIdentity(java.security.Identity) definition code for java.security.IdentityScope.removeIdentity(java.security.Identity)

public abstract void removeIdentity(Identity sample code for java.security.Identity definition code for java.security.Identity  identity)
                             throws KeyManagementException sample code for java.security.KeyManagementException definition code for java.security.KeyManagementException 
Deprecated. 
Removes an identity from this identity scope.

Parameters:
identity - the identity to be removed.
Throws:
KeyManagementException sample code for java.security.KeyManagementException definition code for java.security.KeyManagementException - if the identity is missing, or another exception occurs.

identities sample code for java.security.IdentityScope.identities() definition code for java.security.IdentityScope.identities()

public abstract Enumeration sample code for java.util.Enumeration definition code for java.util.Enumeration <Identity sample code for java.security.Identity definition code for java.security.Identity > identities()
Deprecated. 
Returns an enumeration of all identities in this identity scope.

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

toString sample code for java.security.IdentityScope.toString() definition code for java.security.IdentityScope.toString()

public String sample code for java.lang.String definition code for java.lang.String  toString()
Deprecated. 
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 sample code for java.security.Principal.toString() definition code for java.security.Principal.toString() in interface Principal sample code for java.security.Principal definition code for java.security.Principal
Overrides:
toString sample code for java.security.Identity.toString() definition code for java.security.Identity.toString() in class Identity sample code for java.security.Identity definition code for java.security.Identity
Returns:
a string representation of this identity scope.
See Also:
SecurityManager.checkSecurityAccess(java.lang.String) sample code for java.lang.SecurityManager.checkSecurityAccess(java.lang.String) definition code for java.lang.SecurityManager.checkSecurityAccess(java.lang.String)