Class HTTPHeader

java.lang.Object
eu.europa.esig.dss.jades.HTTPHeader
All Implemented Interfaces:
DSSDocument, Serializable
Direct Known Subclasses:
HTTPHeaderDigest

public class HTTPHeader extends Object implements DSSDocument
The class represents an HTTP Header to be signed See ETSI TS 119 182-1 "5.2.8.2 Mechanism HttpHeaders" The class shall be used only for JAdES detached SigDMechanism.HTTP_HEADERS mechanism
See Also:
  • Constructor Details

    • HTTPHeader

      public HTTPHeader(String name, String value)
      The default constructor
      Parameters:
      name - String of the header
      value - String of the header
  • Method Details

    • getName

      public String getName()
      Returns a String name (key) of the HTTP Header
      Specified by:
      getName in interface DSSDocument
      Returns:
      String representing the name of the current DSSDocument
    • getValue

      public String getValue()
      Returns a String value of the HTTP Header
      Returns:
      String value
    • setValue

      public void setValue(String value)
      Sets a String value of HTTP Header
      Parameters:
      value - String value
    • openStream

      public InputStream openStream()
      Description copied from interface: DSSDocument
      Opens a InputStream on the DSSDocument contents. The type of the InputStream depends on the type of the DSSDocument.
      Specified by:
      openStream in interface DSSDocument
      Returns:
      an InputStream
    • writeTo

      public void writeTo(OutputStream stream) throws IOException
      Description copied from interface: DSSDocument
      Writes the content of the document to the provided OutputStream
      Specified by:
      writeTo in interface DSSDocument
      Parameters:
      stream - the output stream where to write
      Throws:
      IOException - if any IO error happens
    • setName

      public void setName(String name)
      Description copied from interface: DSSDocument
      This method sets the name of the DSSDocument.
      Specified by:
      setName in interface DSSDocument
      Parameters:
      name - the document name
    • getMimeType

      public MimeType getMimeType()
      Description copied from interface: DSSDocument
      Returns the mime-type of the DSSDocument.
      Specified by:
      getMimeType in interface DSSDocument
      Returns:
      MimeType
    • setMimeType

      public void setMimeType(MimeType mimeType)
      Description copied from interface: DSSDocument
      This method sets the mime-type of the DSSDocument.
      Specified by:
      setMimeType in interface DSSDocument
      Parameters:
      mimeType - MimeType
    • save

      public void save(String filePath) throws IOException
      Description copied from interface: DSSDocument
      Save the content of the DSSDocument to the file.
      Specified by:
      save in interface DSSDocument
      Parameters:
      filePath - the path to the file to be created
      Throws:
      IOException - if any IO error happens
    • getDigest

      public String getDigest(DigestAlgorithm digestAlgorithm)
      Description copied from interface: DSSDocument
      This method returns the encoded digest value of the current DSSDocument using the base64 algorithm.
      Specified by:
      getDigest in interface DSSDocument
      Parameters:
      digestAlgorithm - DigestAlgorithm
      Returns:
      base64 encoded String