Class TimestampIdentifierBuilder

java.lang.Object
eu.europa.esig.dss.spi.x509.tsp.TimestampIdentifierBuilder
All Implemented Interfaces:
IdentifierBuilder, Serializable
Direct Known Subclasses:
EvidenceRecordTimestampIdentifierBuilder, PdfTimestampTokenIdentifierBuilder, SignatureTimestampIdentifierBuilder, VriDictionaryTimestampIdentifierBuilder

public class TimestampIdentifierBuilder extends Object implements IdentifierBuilder
Builds an eu.europa.esig.dss.spi.x509.tsp.TimestampTokenIdentifier for the provided eu.europa.esig.dss.spi.x509.tsp.TimestampToken. This class provided a format independent implementation. Please use inherited classed for format-specific implementations.
See Also:
  • Field Details

    • timestampTokenBinaries

      protected final byte[] timestampTokenBinaries
      Time-stamp token to build an identifier for
  • Constructor Details

    • TimestampIdentifierBuilder

      public TimestampIdentifierBuilder(byte[] timestampTokenBinaries)
      Default constructor to build an implementation independent identifier
      Parameters:
      timestampTokenBinaries - byte array representing a DER-encoded time-stamp binary octets
  • Method Details

    • setFilename

      public TimestampIdentifierBuilder setFilename(String filename)
      Sets a time-stamp document filename
      Parameters:
      filename - String
      Returns:
      this TimestampIdentifierBuilder
    • build

      public TimestampTokenIdentifier build()
      Builds TimestampTokenIdentifier for the provided eu.europa.esig.dss.spi.x509.tsp.TimestampToken
      Specified by:
      build in interface IdentifierBuilder
      Returns:
      TimestampTokenIdentifier
    • buildBinaries

      protected byte[] buildBinaries()
      Builds unique binary data describing the time-stamp token
      Returns:
      a byte array
    • writeTimestampBinaries

      protected void writeTimestampBinaries(ByteArrayOutputStream baos) throws IOException
      Writes DER-encoded binaries of the current time-stamp token to the given ByteArrayOutputStream
      Parameters:
      baos - ByteArrayOutputStream to write time-stamp binaries to
      Throws:
      IOException - if an exception occurs
    • writeTimestampPosition

      protected void writeTimestampPosition(ByteArrayOutputStream baos) throws IOException
      Writes the current time-stamp position within a document
      Parameters:
      baos - ByteArrayOutputStream to add data to
      Throws:
      IOException - if an exception occurs
    • getUniquePositionId

      protected String getUniquePositionId()
      Returns Id representing a current signature position in a file, considering its pre-siblings, master signatures when present
      Returns:
      String position id
    • getTimestampPosition

      protected Object getTimestampPosition()
      Returns a position of a time-stamp token within a document among other time-stamps
      Returns:
      time-stamp position identifier