Package eu.europa.esig.dss.asic.common
Class AbstractASiCManifestBuilder
java.lang.Object
eu.europa.esig.dss.asic.common.AbstractASiCManifestBuilder
- Direct Known Subclasses:
ASiCEvidenceRecordManifestBuilder
,ASiCEWithCAdESArchiveManifestBuilder
,ASiCEWithCAdESManifestBuilder
The abstract class to build a Manifest for ASiC
-
Field Summary
Modifier and TypeFieldDescriptionprotected final ASiCContent
The container representationprotected final DigestAlgorithm
The DigestAlgorithm to use for reference digests computationprotected final String
The URI of a document signing the manifest -
Constructor Summary
ModifierConstructorDescriptionprotected
AbstractASiCManifestBuilder
(ASiCContent asicContent, String sigReferenceUri) Constructor to instantiate AbstractASiCManifestBuilder with a default SHA-256 digest algorithmprotected
AbstractASiCManifestBuilder
(ASiCContent asicContent, String sigReferenceUri, DigestAlgorithm digestAlgorithm) Constructor to instantiate AbstractASiCManifestBuilder with a provided digest algorithm -
Method Summary
Modifier and TypeMethodDescriptionprotected Element
addDataObjectReference
(Document documentDom, Element asicManifestDom, DSSDocument document, DigestAlgorithm digestAlgorithm) Adds a<DataObjectReference>
elementprotected void
addDataObjectReferences
(Document documentDom, Element asicManifestDom) This method adds references to data objects, corresponding to theASiCContentDocumentFilter
configurationprotected void
addSigReference
(Document documentDom, Element asicManifestDom) Adds a<SigReference>
elementbuild()
Builds the ArchiveManifest and returns the Document Nodeprotected Document
buildDom()
Builds the initial XML documentprotected Element
createRootElement
(Document documentDom) Creates a root element<asic:ASiCManifest xmlns:asic="http://uri.etsi.org/02918/v1.2.1#">
protected ASiCContentDocumentFilter
Gets anASiCContentDocumentFilter
used to filter the documents to be referenced within ASiC Manifestprotected abstract String
Returns a final filename of the manifestprotected abstract MimeType
(Optional) Returns theMimeType
to be used for a signature reference (signature or timestamp)protected abstract ASiCContentDocumentFilter
Gets anASiCContentDocumentFilter
used to filter the documents to be referenced within ASiC Manifestprotected boolean
isRootfile
(DSSDocument document) Specifies whether thedocument
is a Rootfile documentsetAsicContentDocumentFilter
(ASiCContentDocumentFilter asicContentDocumentFilter) Sets anASiCContentDocumentFilter
used to filter the documents to compute hashes for.protected DSSDocument
toDSSDocument
(Document documentDom) TransformsDocument
toDSSDocument
-
Field Details
-
asicContent
The container representation -
sigReferenceUri
The URI of a document signing the manifest -
digestAlgorithm
The DigestAlgorithm to use for reference digests computation
-
-
Constructor Details
-
AbstractASiCManifestBuilder
Constructor to instantiate AbstractASiCManifestBuilder with a default SHA-256 digest algorithm- Parameters:
asicContent
-ASiCContent
sigReferenceUri
-String
-
AbstractASiCManifestBuilder
protected AbstractASiCManifestBuilder(ASiCContent asicContent, String sigReferenceUri, DigestAlgorithm digestAlgorithm) Constructor to instantiate AbstractASiCManifestBuilder with a provided digest algorithm- Parameters:
asicContent
-ASiCContent
representing the structure of the ASiC containersigReferenceUri
-String
name of the document to be linked to the manifest (e.g. name of the signature file)digestAlgorithm
-DigestAlgorithm
to be used for digest computation of DataObjectReference's
-
-
Method Details
-
build
Builds the ArchiveManifest and returns the Document Node- Returns:
DSSDocument
archive manifest
-
buildDom
-
createRootElement
-
addSigReference
-
getSigReferenceMimeType
-
addDataObjectReferences
-
getAsicContentDocumentFilter
Gets anASiCContentDocumentFilter
used to filter the documents to be referenced within ASiC Manifest- Returns:
ASiCContentDocumentFilter
-
setAsicContentDocumentFilter
public AbstractASiCManifestBuilder setAsicContentDocumentFilter(ASiCContentDocumentFilter asicContentDocumentFilter) Sets anASiCContentDocumentFilter
used to filter the documents to compute hashes for. When not set, a defaultASiCContentDocumentFilter
is used for the given manifest type.- Parameters:
asicContentDocumentFilter
-ASiCContentDocumentFilter
- Returns:
- this
ASiCEvidenceRecordDigestBuilder
-
initDefaultAsicContentDocumentFilter
Gets anASiCContentDocumentFilter
used to filter the documents to be referenced within ASiC Manifest- Returns:
ASiCContentDocumentFilter
-
addDataObjectReference
protected Element addDataObjectReference(Document documentDom, Element asicManifestDom, DSSDocument document, DigestAlgorithm digestAlgorithm) Adds a<DataObjectReference>
element- Parameters:
documentDom
-Document
to add the DataObjectReference toasicManifestDom
-Element
containing an asicManifestDom to incorporate the DataObjectReference withindocument
-DSSDocument
to referdigestAlgorithm
-DigestAlgorithm
to use for digest calculation- Returns:
Element
-
isRootfile
Specifies whether thedocument
is a Rootfile document- Parameters:
document
-DSSDocument
to check- Returns:
- TRUE if the Rootfile attribute shall be added for the document's reference, FALSE otherwise
-
toDSSDocument
TransformsDocument
toDSSDocument
- Parameters:
documentDom
-Document
- Returns:
DSSDocument
-
getManifestFilename
-