Class DocumentWithSha2

java.lang.Object
eu.europa.esig.dss.tsl.sha2.DocumentWithSha2
All Implemented Interfaces:
Serializable

public class DocumentWithSha2 extends Object
This class is used to represent a downloaded eu.europa.esig.dss.model.DSSDocument with its corresponding ".sha2" file
See Also:
  • Field Details

    • digestMap

      protected EnumMap<eu.europa.esig.dss.enumerations.DigestAlgorithm, byte[]> digestMap
    • mimeType

      protected eu.europa.esig.dss.enumerations.MimeType mimeType
    • name

      protected String name
  • Constructor Details

    • DocumentWithSha2

      protected DocumentWithSha2(eu.europa.esig.dss.model.DSSDocument document, eu.europa.esig.dss.model.DSSDocument sha2Document)
      Default constructor
      Parameters:
      document - DSSDocument original downloaded document
      sha2Document - DSSDocument corresponding sha2 document, containing digests of the document
  • Method Details

    • getDocument

      public eu.europa.esig.dss.model.DSSDocument getDocument()
      Gets the original document
      Returns:
      DSSDocument
    • getSha2Document

      public eu.europa.esig.dss.model.DSSDocument getSha2Document()
      Gets the downloaded sha2 document corresponding to the document
      Returns:
      DSSDocument
    • addErrorMessage

      protected void addErrorMessage(String errorMessage)
      This method adds an error message occurred during the .sha2 file validation
      Parameters:
      errorMessage - String error
    • getErrors

      public List<String> getErrors()
      Returns a list of errors occurred during processing of .sha2 document. Returns NULL if validation succeeded.
      Returns:
      a list of String errors, if any
    • openStream

      public InputStream openStream()
    • equals

      public boolean equals(Object object)
    • hashCode

      public int hashCode()
    • save

      public void save(String arg0) throws IOException
      Throws:
      IOException
    • writeTo

      public void writeTo(OutputStream arg0) throws IOException
      Throws:
      IOException
    • getMimeType

      public eu.europa.esig.dss.enumerations.MimeType getMimeType()
    • setMimeType

      public void setMimeType(eu.europa.esig.dss.enumerations.MimeType arg0)
    • getName

      public String getName()
    • setName

      public void setName(String arg0)
    • getDigest

      public eu.europa.esig.dss.model.Digest getDigest(eu.europa.esig.dss.enumerations.DigestAlgorithm arg0)
    • getDigestValue

      public byte[] getDigestValue(eu.europa.esig.dss.enumerations.DigestAlgorithm arg0)
    • toString

      public String toString()
      Overrides:
      toString in class Object