eu.europa.esig.dss.asic.signature.asice.DataToSignASiCEWithCAdESFromArchive Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of dss-asic-cades Show documentation
Show all versions of dss-asic-cades Show documentation
DSS ASiC with CAdES contains the code for the creation and validation of ASiC containers with CAdES signature(s).
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;
}
}