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
FieldsModifier and TypeFieldDescriptionprotected final ASiCContentThe container representationprotected final DigestAlgorithmThe DigestAlgorithm to use for reference digests computationprotected final StringThe URI of a document signing the manifest -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractASiCManifestBuilder(ASiCContent asicContent, String sigReferenceUri) Constructor to instantiate AbstractASiCManifestBuilder with a default SHA-256 digest algorithmprotectedAbstractASiCManifestBuilder(ASiCContent asicContent, String sigReferenceUri, DigestAlgorithm digestAlgorithm) Constructor to instantiate AbstractASiCManifestBuilder with a provided digest algorithm -
Method Summary
Modifier and TypeMethodDescriptionprotected ElementaddDataObjectReference(Document documentDom, Element asicManifestDom, DSSDocument document, DigestAlgorithm digestAlgorithm) Adds a<DataObjectReference>elementprotected voidaddDataObjectReferences(Document documentDom, Element asicManifestDom) This method adds references to data objects, corresponding to theASiCContentDocumentFilterconfigurationprotected voidaddSigReference(Document documentDom, Element asicManifestDom) Adds a<SigReference>elementbuild()Builds the ArchiveManifest and returns the Document Nodeprotected DocumentbuildDom()Builds the initial XML documentprotected ElementcreateRootElement(Document documentDom) Creates a root element<asic:ASiCManifest xmlns:asic="http://uri.etsi.org/02918/v1.2.1#">protected ASiCContentDocumentFilterGets anASiCContentDocumentFilterused to filter the documents to be referenced within ASiC Manifestprotected abstract StringReturns a final filename of the manifestprotected abstract MimeType(Optional) Returns theMimeTypeto be used for a signature reference (signature or timestamp)protected abstract ASiCContentDocumentFilterGets anASiCContentDocumentFilterused to filter the documents to be referenced within ASiC Manifestprotected booleanisRootfile(DSSDocument document) Specifies whether thedocumentis a Rootfile documentsetAsicContentDocumentFilter(ASiCContentDocumentFilter asicContentDocumentFilter) Sets anASiCContentDocumentFilterused to filter the documents to compute hashes for.protected DSSDocumenttoDSSDocument(Document documentDom) TransformsDocumenttoDSSDocument
-
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-ASiCContentsigReferenceUri-String
-
AbstractASiCManifestBuilder
protected AbstractASiCManifestBuilder(ASiCContent asicContent, String sigReferenceUri, DigestAlgorithm digestAlgorithm) Constructor to instantiate AbstractASiCManifestBuilder with a provided digest algorithm- Parameters:
asicContent-ASiCContentrepresenting the structure of the ASiC containersigReferenceUri-Stringname of the document to be linked to the manifest (e.g. name of the signature file)digestAlgorithm-DigestAlgorithmto be used for digest computation of DataObjectReference's
-
-
Method Details
-
build
Builds the ArchiveManifest and returns the Document Node- Returns:
DSSDocumentarchive manifest
-
buildDom
-
createRootElement
-
addSigReference
-
getSigReferenceMimeType
-
addDataObjectReferences
-
getAsicContentDocumentFilter
Gets anASiCContentDocumentFilterused to filter the documents to be referenced within ASiC Manifest- Returns:
ASiCContentDocumentFilter
-
setAsicContentDocumentFilter
public AbstractASiCManifestBuilder setAsicContentDocumentFilter(ASiCContentDocumentFilter asicContentDocumentFilter) Sets anASiCContentDocumentFilterused to filter the documents to compute hashes for. When not set, a defaultASiCContentDocumentFilteris used for the given manifest type.- Parameters:
asicContentDocumentFilter-ASiCContentDocumentFilter- Returns:
- this
ASiCEvidenceRecordDigestBuilder
-
initDefaultAsicContentDocumentFilter
Gets anASiCContentDocumentFilterused 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-Documentto add the DataObjectReference toasicManifestDom-Elementcontaining an asicManifestDom to incorporate the DataObjectReference withindocument-DSSDocumentto referdigestAlgorithm-DigestAlgorithmto use for digest calculation- Returns:
Element
-
isRootfile
Specifies whether thedocumentis a Rootfile document- Parameters:
document-DSSDocumentto check- Returns:
- TRUE if the Rootfile attribute shall be added for the document's reference, FALSE otherwise
-
toDSSDocument
TransformsDocumenttoDSSDocument- Parameters:
documentDom-Document- Returns:
DSSDocument
-
getManifestFilename
-