Package eu.europa.esig.dss.jades
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:
- Serialized Form
-
Constructor Summary
Constructors Constructor Description HTTPHeader(String name, String value)
The default constructor -
Method Summary
Modifier and Type Method Description String
getAbsolutePath()
Returns theString
representing the absolute path to the encapsulated document.String
getDigest(DigestAlgorithm digestAlgorithm)
This method returns the encoded digest value of the currentDSSDocument
using the base64 algorithm.MimeType
getMimeType()
Returns the mime-type of theDSSDocument
.String
getName()
Returns a String name (key) of the HTTP HeaderString
getValue()
Returns a String value of the HTTP HeaderInputStream
openStream()
Opens aInputStream
on theDSSDocument
contents.void
save(String filePath)
Save the content of the DSSDocument to the file.void
setMimeType(MimeType mimeType)
This method sets the mime-type of theDSSDocument
.void
setName(String name)
This method sets the name of theDSSDocument
.void
setValue(String value)
Sets a String value of HTTP Headervoid
writeTo(OutputStream stream)
Writes the content of the document to the provided OutputStream
-
Constructor Details
-
Method Details
-
getName
Returns a String name (key) of the HTTP Header- Specified by:
getName
in interfaceDSSDocument
- Returns:
String
representing the name of the currentDSSDocument
-
getValue
Returns a String value of the HTTP Header- Returns:
String
value
-
setValue
Sets a String value of HTTP Header- Parameters:
value
-String
value
-
openStream
Description copied from interface:DSSDocument
Opens aInputStream
on theDSSDocument
contents. The type of theInputStream
depends on the type of theDSSDocument
.- Specified by:
openStream
in interfaceDSSDocument
- Returns:
- an
InputStream
-
writeTo
Description copied from interface:DSSDocument
Writes the content of the document to the provided OutputStream- Specified by:
writeTo
in interfaceDSSDocument
- Parameters:
stream
- the output stream where to write- Throws:
IOException
- if any IO error happens
-
setName
Description copied from interface:DSSDocument
This method sets the name of theDSSDocument
.- Specified by:
setName
in interfaceDSSDocument
- Parameters:
name
- the document name
-
getAbsolutePath
Description copied from interface:DSSDocument
Returns theString
representing the absolute path to the encapsulated document.- Specified by:
getAbsolutePath
in interfaceDSSDocument
- Returns:
String
representing the absolute path to the encapsulated document.
-
getMimeType
Description copied from interface:DSSDocument
Returns the mime-type of theDSSDocument
.- Specified by:
getMimeType
in interfaceDSSDocument
- Returns:
MimeType
-
setMimeType
Description copied from interface:DSSDocument
This method sets the mime-type of theDSSDocument
.- Specified by:
setMimeType
in interfaceDSSDocument
- Parameters:
mimeType
-MimeType
-
save
Description copied from interface:DSSDocument
Save the content of the DSSDocument to the file.- Specified by:
save
in interfaceDSSDocument
- Parameters:
filePath
- the path to the file to be created- Throws:
IOException
- if any IO error happens
-
getDigest
Description copied from interface:DSSDocument
This method returns the encoded digest value of the currentDSSDocument
using the base64 algorithm.- Specified by:
getDigest
in interfaceDSSDocument
- Parameters:
digestAlgorithm
-DigestAlgorithm
- Returns:
- base64 encoded
String
-