All Downloads are FREE. Search and download functionalities are using the official Maven repository.

eu.europa.esig.dss.asic.signature.asice.DataToSignASiCEWithCAdESFromArchive Maven / Gradle / Ivy

Go to download

DSS ASiC with CAdES contains the code for the creation and validation of ASiC containers with CAdES signature(s).

There is a newer version: 6.0.d4j.2
Show newest version
package eu.europa.esig.dss.asic.signature.asice;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

import eu.europa.esig.dss.DSSDocument;
import eu.europa.esig.dss.asic.ASiCWithCAdESSignatureParameters;
import eu.europa.esig.dss.asic.signature.GetDataToSignASiCWithCAdESHelper;

public class DataToSignASiCEWithCAdESFromArchive extends AbstractDataToSignASiCEWithCAdES implements GetDataToSignASiCWithCAdESHelper {

	private final List signedDocuments;
	private final List existingSignatures;
	private final List existingManifests;
	private final ASiCWithCAdESSignatureParameters parameters;

	private DSSDocument toBeSigned;

	public DataToSignASiCEWithCAdESFromArchive(List signedDocuments, List existingSignatures, List existingManifests,
			ASiCWithCAdESSignatureParameters parameters) {
		this.signedDocuments = signedDocuments;
		this.existingSignatures = existingSignatures;
		this.existingManifests = existingManifests;
		this.parameters = parameters;
	}

	@Override
	public String getSignatureFilename() {
		return getSignatureFileName(parameters.aSiC(), existingSignatures);
	}

	@Override
	public DSSDocument getToBeSigned() {
		if (toBeSigned == null) {
			toBeSigned = getASiCManifest(signedDocuments, existingSignatures, existingManifests, parameters);
		}
		return toBeSigned;
	}

	@Override
	public List getDetachedContents() {
		return Collections.emptyList();
	}

	@Override
	public List getSignedDocuments() {
		return signedDocuments;
	}

	@Override
	public List getManifestFiles() {
		List manifests = new ArrayList(existingManifests);
		manifests.add(getToBeSigned());
		return manifests;
	}

	@Override
	public List getSignatures() {
		return existingSignatures;
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy