Package java.security

Class Identity

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

@Deprecated
public abstract class Identity
extends Object
implements Principal, Serializable
Deprecated.
Use Principal, KeyStore and the java.security.cert package instead.
Identity represents an identity like a person or a company.
See Also:
Serialized Form
  • Constructor Summary

    Constructors
    Modifier Constructor Description
    protected Identity()
    Deprecated.
    Constructs a new instance of Identity.
      Identity​(String name)
    Deprecated.
    Creates a new instance of Identity with the specified name.
      Identity​(String name, IdentityScope scope)
    Deprecated.
    Creates a new instance of Identity with the specified name and the scope of this Identity.
  • Method Summary

    Modifier and Type Method Description
    void addCertificate​(Certificate certificate)
    Deprecated.
    Adds a Certificate to this Identity.
    Certificate[] certificates()
    Deprecated.
    Returns the certificates for this Identity.
    boolean equals​(Object obj)
    Deprecated.
    Compares the specified object with this Identity for equality and returns true if the specified object is equal, false otherwise.
    String getInfo()
    Deprecated.
    Returns the information string of this Identity.
    String getName()
    Deprecated.
    Returns the name of this Identity.
    PublicKey getPublicKey()
    Deprecated.
    Returns the PublicKey associated with this Identity.
    IdentityScope getScope()
    Deprecated.
    Returns the IdentityScope of this Identity.
    int hashCode()
    Deprecated.
    Returns the hash code value for this Identity.
    protected boolean identityEquals​(Identity identity)
    Deprecated.
    Compares the specified Identity with this Identity for equality and returns true if the specified object is equal, false otherwise.
    void removeCertificate​(Certificate certificate)
    Deprecated.
    Removes the specified Certificate from this Identity.
    void setInfo​(String info)
    Deprecated.
    Sets an information string for this Identity.
    void setPublicKey​(PublicKey key)
    Deprecated.
    Sets the specified PublicKey to this Identity.
    String toString()
    Deprecated.
    Returns a string containing a concise, human-readable description of the this Identity including its name and its scope.
    String toString​(boolean detailed)
    Deprecated.
    Returns a string containing a concise, human-readable description of the this Identity.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • Identity

      protected Identity()
      Deprecated.
      Constructs a new instance of Identity.
    • Identity

      public Identity​(String name)
      Deprecated.
      Creates a new instance of Identity with the specified name.
      Parameters:
      name - the name of this Identity.
    • Identity

      public Identity​(String name, IdentityScope scope) throws KeyManagementException
      Deprecated.
      Creates a new instance of Identity with the specified name and the scope of this Identity.
      Parameters:
      name - the name of this Identity.
      scope - the IdentityScope of this Identity.
      Throws:
      KeyManagementException - if an Identity with the same name is already present in the specified scope.
  • Method Details

    • addCertificate

      public void addCertificate​(Certificate certificate) throws KeyManagementException
      Deprecated.
      Adds a Certificate to this Identity.
      Parameters:
      certificate - the Certificate to be added to this Identity.
      Throws:
      KeyManagementException - if the certificate is not valid.
    • removeCertificate

      public void removeCertificate​(Certificate certificate) throws KeyManagementException
      Deprecated.
      Removes the specified Certificate from this Identity.
      Parameters:
      certificate - the Certificate to be removed.
      Throws:
      KeyManagementException - if the certificate is not found.
    • certificates

      public Certificate[] certificates()
      Deprecated.
      Returns the certificates for this Identity. External modifications of the returned array has no impact on this Identity.
      Returns:
      the Certificates for this Identity
    • identityEquals

      protected boolean identityEquals​(Identity identity)
      Deprecated.
      Compares the specified Identity with this Identity for equality and returns true if the specified object is equal, false otherwise.

      To be equal, two Identity objects need to have the same name and the same public keys.

      Parameters:
      identity - the identity to check for equality.
      Returns:
      true if the Identity objects are equal, false otherwise.
    • toString

      public String toString​(boolean detailed)
      Deprecated.
      Returns a string containing a concise, human-readable description of the this Identity.
      Parameters:
      detailed - whether or not this method should return detailed information.
      Returns:
      a printable representation for this Permission.
    • getScope

      public final IdentityScope getScope()
      Deprecated.
      Returns the IdentityScope of this Identity.
      Returns:
      the IdentityScope of this Identity.
    • setPublicKey

      public void setPublicKey​(PublicKey key) throws KeyManagementException
      Deprecated.
      Sets the specified PublicKey to this Identity.
      Parameters:
      key - the PublicKey to be set.
      Throws:
      KeyManagementException - if another Identity in the same scope as this Identity already has the same PublicKey.
    • getPublicKey

      public PublicKey getPublicKey()
      Deprecated.
      Returns the PublicKey associated with this Identity.
      Returns:
      the PublicKey associated with this Identity.
    • setInfo

      public void setInfo​(String info)
      Deprecated.
      Sets an information string for this Identity.
      Parameters:
      info - the information to be set.
    • getInfo

      public String getInfo()
      Deprecated.
      Returns the information string of this Identity.
      Returns:
      the information string of this Identity.
    • equals

      public final boolean equals​(Object obj)
      Deprecated.
      Compares the specified object with this Identity for equality and returns true if the specified object is equal, false otherwise. Identity objects are considered equal, if they have the same name and are in the same scope.
      Specified by:
      equals in interface Principal
      Overrides:
      equals in class Object
      Parameters:
      obj - object to be compared for equality with this Identity.
      Returns:
      true if the specified object is equal to this Identity, otherwise false.
      See Also:
      Object.hashCode()
    • getName

      public final String getName()
      Deprecated.
      Returns the name of this Identity.
      Specified by:
      getName in interface Principal
      Returns:
      the name of this Identity.
    • hashCode

      public int hashCode()
      Deprecated.
      Returns the hash code value for this Identity. Returns the same hash code for Identitys that are equal to each other as required by the general contract of Object.hashCode().
      Specified by:
      hashCode in interface Principal
      Overrides:
      hashCode in class Object
      Returns:
      the hash code value for this Identity.
      See Also:
      Object.equals(Object), equals(Object)
    • toString

      public String toString()
      Deprecated.
      Returns a string containing a concise, human-readable description of the this Identity including its name and its scope.
      Specified by:
      toString in interface Principal
      Overrides:
      toString in class Object
      Returns:
      a printable representation for this Identity.