Module java.base
Package java.security

Class Identity

java.lang.Object
java.security.Identity
All Implemented Interfaces:
Serializable, Principal
Direct Known Subclasses:
IdentityScope, Signer

@Deprecated(since="1.2", forRemoval=true) public abstract class Identity extends Object implements Principal, Serializable
Deprecated, for removal: This API element is subject to removal in a future version.
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 identities: real-world objects such as people, companies or organizations whose identities can be authenticated using their public keys. Identities may also be more abstract (or concrete) constructs, such as daemon threads or smart cards.

All Identity objects have a name and a public key. Names are immutable. Identities may also be scoped. That is, if an Identity is specified to have a particular scope, then the name and public key of the Identity are unique within that scope.

An Identity also has a set of certificates (all certifying its own public key). The Principal names specified in these certificates need not be the same, only the key.

An Identity can be subclassed, to include postal and email addresses, telephone numbers, images of faces and logos, and so on.

Since:
1.1
See Also:
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    Deprecated, for removal: This API element is subject to removal in a future version.
    Constructor for serialization only.
     
    Deprecated, for removal: This API element is subject to removal in a future version.
    Constructs an identity with the specified name and no scope.
     
    Deprecated, for removal: This API element is subject to removal in a future version.
    Constructs an identity with the specified name and scope.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
    Adds a certificate for this identity.
    Deprecated, for removal: This API element is subject to removal in a future version.
    Returns a copy of all the certificates for this identity.
    final boolean
    equals(Object identity)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Tests for equality between the specified object and this identity.
    Deprecated, for removal: This API element is subject to removal in a future version.
    Returns general information previously specified for this identity.
    final String
    Deprecated, for removal: This API element is subject to removal in a future version.
    Returns this identity's name.
    Deprecated, for removal: This API element is subject to removal in a future version.
    Returns this identity's public key.
    Deprecated, for removal: This API element is subject to removal in a future version.
    Returns this identity's scope.
    int
    Deprecated, for removal: This API element is subject to removal in a future version.
    Returns a hashcode for this identity.
    protected boolean
    Deprecated, for removal: This API element is subject to removal in a future version.
    Tests for equality between the specified identity and this identity.
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
    Removes a certificate from this identity.
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
    Specifies a general information string for this identity.
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
    Sets this identity's public key.
    Deprecated, for removal: This API element is subject to removal in a future version.
    Returns a short string describing this identity, telling its name and its scope (if any).
    toString(boolean detailed)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Returns a string representation of this identity, with optionally more details than that provided by the toString method without any arguments.

    Methods declared in class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods declared in interface java.security.Principal

    implies
  • Constructor Details

    • Identity

      protected Identity()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Constructor for serialization only.
    • Identity

      public Identity(String name, IdentityScope scope) throws KeyManagementException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Constructs an identity with the specified name and scope.
      Parameters:
      name - the identity name.
      scope - the scope of the identity.
      Throws:
      KeyManagementException - if there is already an identity with the same name in the scope.
    • Identity

      public Identity(String name)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Constructs an identity with the specified name and no scope.
      Parameters:
      name - the identity name.
  • Method Details

    • getName

      public final String getName()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns this identity's name.
      Specified by:
      getName in interface Principal
      Returns:
      the name of this identity.
    • getScope

      public final IdentityScope getScope()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns this identity's scope.
      Returns:
      the scope of this identity.
    • getPublicKey

      public PublicKey getPublicKey()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns this identity's public key.
      Returns:
      the public key for this identity.
      See Also:
    • setPublicKey

      public void setPublicKey(PublicKey key) throws