Top Description Fields Constructors Methods
java.security

public abstract Class IdentityScope

extends Identity
Class Inheritance
Annotations
@Deprecated
since:1.2
forRemoval:true
@SuppressWarnings:removal
Imports
java.io.Serializable, java.util.Enumeration, .Properties

Deprecated

for removal since 1.2.

This class is deprecated and subject to removal in a future version of Java SE. It has been replaced by java.security.KeyStore, the java.security.cert package, and java.security.Principal.

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.

Author
Benjamin Renaud
Since
1.1
See Also
Identity, Signer, Principal, Key

Field Summary

Modifier and TypeField and Description
private static IdentityScope
scope

Hides java.security.Identity.scope.

References Deprecated IdentityScope is deprecated or references (maybe indirectly) at least one deprecated element.
private static final long
Inherited from java.security.Identity:
certificatesinfo

Constructor Summary

AccessConstructor and Description
protected
IdentityScope()

This constructor is used for serialization only and should not be used by subclasses.

public
IdentityScope(String
the scope name.
name
)

Constructs a new identity scope with the specified name.

public
IdentityScope(String
the scope name.
name
,
IdentityScope
the scope for the new identity scope.
scope
)
References Deprecated IdentityScope is deprecated or references (maybe indirectly) at least one deprecated element.

Constructs a new identity scope with the specified name and scope.

Method Summary

Modifier and TypeMethod and Description
public abstract void
addIdentity(Identity
the Identity to be added.
identity
)
References Deprecated Identity is deprecated or references (maybe indirectly) at least one deprecated element.

Adds an Identity to this identity scope.

private static void
public abstract Identity

Returns:

the Identity named name, or null if there are no identities named name in this scope.
getIdentity
(String
the name of the Identity to be retrieved.
name
)
References Deprecated Identity is deprecated or references (maybe indirectly) at least one deprecated element.

Returns the Identity in this scope with the specified name (if any).

public Identity

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
(Principal
the principal corresponding to the Identity to be retrieved.
principal
)
References Deprecated Identity is deprecated or references (maybe indirectly) at least one deprecated element.

Retrieves the Identity whose name is the same as that of the specified principal.

public abstract Identity

Returns:

the identity with the given key, or null if there are no identities in this scope with that key.
getIdentity
(PublicKey
the public key for the identity to be returned.
key
)
References Deprecated Identity is deprecated or references (maybe indirectly) at least one deprecated element.

Retrieves the identity with the specified public key.

public static IdentityScope

Returns:

the system's identity scope, or null if none has been set.
getSystemScope
()
References Deprecated IdentityScope is deprecated or references (maybe indirectly) at least one deprecated element.

Returns the system's identity scope.

public abstract Enumeration<Identity>

Returns:

an enumeration of all identities in this identity scope.
identities
()

Returns an enumeration of all identities in this identity scope.

private static void
public abstract void
removeIdentity(Identity
the Identity to be removed.
identity
)
References Deprecated Identity is deprecated or references (maybe indirectly) at least one deprecated element.

Removes an Identity from this identity scope.

protected static void
setSystemScope(IdentityScope
the scope to set.
scope
)
References Deprecated IdentityScope is deprecated or references (maybe indirectly) at least one deprecated element.

Sets the system's identity scope.

public abstract int

Returns:

the number of identities within this identity scope.
size
()

Returns the number of identities within this identity scope.

public String

Returns:

a string representation of this identity scope.
toString
()

Overrides java.security.Identity.toString.

Implements java.security.Principal.toString.

Returns a string representation of this identity scope, including its name, its scope name, and the number of identities in this identity scope.

Inherited from java.security.Identity:
addCertificatecertificatesequalsfullNamegetInfogetNamegetPublicKeygetScopehashCodeidentityEqualsprintCertificatesprintKeysremoveCertificatesetInfosetPublicKeytoString

Field Detail

scopeback to summary
private static IdentityScope scope

Hides java.security.Identity.scope.

References Deprecated

IdentityScope is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

serialVersionUIDback to summary
private static final long serialVersionUID

Hides java.security.Identity.serialVersionUID.

Annotations
@Serial

Constructor Detail

IdentityScopeback to summary
protected IdentityScope()

This constructor is used for serialization only and should not be used by subclasses.

IdentityScopeback to summary
public IdentityScope(String name)

Constructs a new identity scope with the specified name.

Parameters
name:String

the scope name.

IdentityScopeback to summary
public IdentityScope(String name, IdentityScope scope) throws KeyManagementException

References Deprecated

IdentityScope is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

Constructs a new identity scope with the specified name and scope.

Parameters
name:String

the scope name.

scope:IdentityScope

the scope for the new identity scope.

Exceptions
KeyManagementException:
if there is already an Identity with the same name in the scope.

Method Detail

addIdentityback to summary
public abstract void addIdentity(Identity identity) throws KeyManagementException

References Deprecated

Identity is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

Adds an Identity to this identity scope.

Parameters
identity:Identity

the Identity to be added.

Exceptions
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.
checkback to summary
private static void check(String directive)

Hides java.security.Identity.check.

getIdentityback to summary
public abstract Identity getIdentity(String name)

References Deprecated

Identity is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

Returns the Identity in this scope with the specified name (if any).

Parameters
name:String

the name of the Identity to be retrieved.

Returns:Identity

the Identity named name, or null if there are no identities named name in this scope.

getIdentityback to summary
public Identity getIdentity(Principal principal)

References Deprecated

Identity is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

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

Parameters
principal:Principal

the principal corresponding to the Identity to be retrieved.

Returns:Identity

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.

getIdentityback to summary
public abstract Identity getIdentity(PublicKey key)

References Deprecated

Identity is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

Retrieves the identity with the specified public key.

Parameters
key:PublicKey

the public key for the identity to be returned.

Returns:Identity

the identity with the given key, or null if there are no identities in this scope with that key.

getSystemScopeback to summary
public static IdentityScope getSystemScope()

References Deprecated

IdentityScope is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

Returns the system's identity scope.

Returns:IdentityScope

the system's identity scope, or null if none has been set.

See Also
setSystemScope
identitiesback to summary
public abstract Enumeration<Identity> identities()

Returns an enumeration of all identities in this identity scope.

Returns:Enumeration<Identity>

an enumeration of all identities in this identity scope.

initializeSystemScopeback to summary
private static void initializeSystemScope()
removeIdentityback to summary
public abstract void removeIdentity(Identity identity) throws KeyManagementException

References Deprecated

Identity is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

Removes an Identity from this identity scope.

Parameters
identity:Identity

the Identity to be removed.

Exceptions
KeyManagementException:
if the identity is missing, or another exception occurs.
setSystemScopeback to summary
protected static void setSystemScope(IdentityScope scope)

References Deprecated

IdentityScope is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

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:IdentityScope

the scope to set.

Exceptions
SecurityException:
if a security manager exists and its checkSecurityAccess method doesn't allow setting the identity scope.
See Also
getSystemScope, SecurityManager#checkSecurityAccess
sizeback to summary
public abstract int size()

Returns the number of identities within this identity scope.

Returns:int

the number of identities within this identity scope.

toStringback to summary
public String toString()

Overrides java.security.Identity.toString.

Implements java.security.Principal.toString.

Returns a string representation of this identity scope, including its name, its scope name, and the number of identities in this identity scope.

Returns:String

a string representation of this identity scope.