Class Identifier

java.lang.Object
eu.europa.esig.dss.model.identifier.Identifier
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
DataIdentifier, EntityIdentifier, KeyIdentifier, MultipleDigestIdentifier, X500NameIdentifier

public abstract class Identifier extends Object implements Serializable
This class is used to obtain a unique id for an object
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected static final eu.europa.esig.dss.enumerations.DigestAlgorithm
    The DigestAlgorithm to use
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    Identifier(String prefix, byte[] data)
    The constructor to get an identifier computed from the binaries with a defined prefix
    protected
    Identifier(String prefix, Digest digest)
    The constructor to get an identifier computed provided digest with a defined prefix
  • Method Summary

    Modifier and Type
    Method
    Description
    Return an ID conformant to XML Id
    boolean
     
    protected MessageDigest
    getMessageDigest(eu.europa.esig.dss.enumerations.DigestAlgorithm digestAlgorithm)
    Gets MessageDigest of the DigestAlgorithm
    int
     
     

    Methods inherited from class java.lang.Object

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

    • DIGEST_ALGO

      protected static final eu.europa.esig.dss.enumerations.DigestAlgorithm DIGEST_ALGO
      The DigestAlgorithm to use
  • Constructor Details

    • Identifier

      protected Identifier(String prefix, byte[] data)
      The constructor to get an identifier computed from the binaries with a defined prefix
      Parameters:
      prefix - String to be added in the beginning of a String identifier
      data - a byte array to compute the identifier from
    • Identifier

      protected Identifier(String prefix, Digest digest)
      The constructor to get an identifier computed provided digest with a defined prefix
      Parameters:
      prefix - String to be added in the beginning of a String identifier
      digest - Digest to use for a HEX value string
  • Method Details

    • getMessageDigest

      protected MessageDigest getMessageDigest(eu.europa.esig.dss.enumerations.DigestAlgorithm digestAlgorithm)
      Gets MessageDigest of the DigestAlgorithm
      Parameters:
      digestAlgorithm - DigestAlgorithm
      Returns:
      MessageDigest
    • asXmlId

      public String asXmlId()
      Return an ID conformant to XML Id
      Returns:
      the XML encoded ID
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object