Package eu.europa.esig.dss.asic.cades
Class SimpleASiCWithCAdESFilenameFactory
java.lang.Object
eu.europa.esig.dss.asic.common.AbstractASiCFilenameFactory
eu.europa.esig.dss.asic.cades.DefaultASiCWithCAdESFilenameFactory
eu.europa.esig.dss.asic.cades.SimpleASiCWithCAdESFilenameFactory
- All Implemented Interfaces:
ASiCWithCAdESFilenameFactory
,Serializable
This class provides a simple way to define custom names for file entries created within an ASiC with CAdES container,
by using set and get methods.
This factory adds "META-INF/" prefix to the filename, when required.
When a target filename for a particular document type is not specified,
then the default processing will take precedence.
NOTE: This factory shall be modified when consequently signing/extending a single container.
WARN: The class does not verify the conformance of the defined filenames to the EN 319 162-1 standard.
- See Also:
-
Constructor Summary
ConstructorDescriptionDefault constructor instantiating factory with null values -
Method Summary
Modifier and TypeMethodDescriptiongetArchiveManifestFilename
(ASiCContent asicContent) Returns a new filename of an archive manifest file to be moved.getDataPackageFilename
(ASiCContent asicContent) Returns a name of a ZIP archive containing signed documents in case of an ASiC-E signature, when applicablegetManifestFilename
(ASiCContent asicContent) Returns a filename of a manifest file to be createdgetSignatureFilename
(ASiCContent asicContent) Returns a filename for a signature file to be createdgetTimestampFilename
(ASiCContent asicContent) Returns a filename for a timestamp file to be createdprotected String
getValidArchiveManifestFilename
(String archiveManifestFilename, ASiCContent asicContent) This method returns a valid archive manifest filename.protected String
getValidManifestFilename
(String manifestFilename, ASiCContent asicContent) This method returns a valid manifest filenameprotected String
getValidSignatureFilename
(String signatureFilename, ASiCContent asicContent) This method returns a valid signature filenameprotected String
getValidTimestampFilename
(String timestampFilename, ASiCContent asicContent) This method returns a valid timestamp filenamevoid
setArchiveManifestFilename
(String archiveManifestFilename) Sets a new filename for the last archive manifest document (when applicable)void
setDataPackageFilename
(String dataPackageFilename) Sets a filename for a new ZIP data package (when applicable)void
setManifestFilename
(String manifestFilename) Sets a filename for a new manifest document (when applicable).void
setSignatureFilename
(String signatureFilename) Sets a filename for a new signature document (when applicable).void
setTimestampFilename
(String timestampFilename) Sets a filename for a new timestamp document (when applicable).Methods inherited from class eu.europa.esig.dss.asic.common.AbstractASiCFilenameFactory
assertASiCContentIsValid, assertFilenameValid, getNextAvailableDocumentName, getValidDataPackageFilename, getWithMetaInfFolder, isAvailableName
-
Constructor Details
-
SimpleASiCWithCAdESFilenameFactory
public SimpleASiCWithCAdESFilenameFactory()Default constructor instantiating factory with null values
-
-
Method Details
-
getSignatureFilename
Description copied from interface:ASiCWithCAdESFilenameFactory
Returns a filename for a signature file to be created- Specified by:
getSignatureFilename
in interfaceASiCWithCAdESFilenameFactory
- Overrides:
getSignatureFilename
in classDefaultASiCWithCAdESFilenameFactory
- Parameters:
asicContent
-ASiCContent
representing a content of an ASiC container- Returns:
String
signature filename
-
setSignatureFilename
Sets a filename for a new signature document (when applicable). NOTE: The name of the signature file shall be: - ASiC-S with CAdES : "META-INF/signature.p7s"; - ASiC-E with CAdES : "META-INF/signature*.p7s". "META-INF/" is optional.- Parameters:
signatureFilename
-String
-
getTimestampFilename
Description copied from interface:ASiCWithCAdESFilenameFactory
Returns a filename for a timestamp file to be created- Specified by:
getTimestampFilename
in interfaceASiCWithCAdESFilenameFactory
- Overrides:
getTimestampFilename
in classDefaultASiCWithCAdESFilenameFactory
- Parameters:
asicContent
-ASiCContent
representing a content of an ASiC container- Returns:
String
timestamp filename
-
setTimestampFilename
Sets a filename for a new timestamp document (when applicable). NOTE: The name of the timestamp file shall be: - ASiC-S with CAdES : "META-INF/timestamp.tst"; - ASiC-E with CAdES : "META-INF/timestamp*.tst". "META-INF/" is optional.- Parameters:
timestampFilename
-String
-
getManifestFilename
Description copied from interface:ASiCWithCAdESFilenameFactory
Returns a filename of a manifest file to be created- Specified by:
getManifestFilename
in interfaceASiCWithCAdESFilenameFactory
- Overrides:
getManifestFilename
in classDefaultASiCWithCAdESFilenameFactory
- Parameters:
asicContent
-ASiCContent
representing a content of an ASiC container- Returns:
String
manifest filename
-
setManifestFilename
Sets a filename for a new manifest document (when applicable). NOTE: The name of the timestamp file shall be: - ASiC-E with CAdES : "META-INF/ASiCManifest*.xml". "META-INF/" is optional.- Parameters:
manifestFilename
-String
-
getArchiveManifestFilename
Description copied from interface:ASiCWithCAdESFilenameFactory
Returns a new filename of an archive manifest file to be moved. NOTE: ASiC-E with CAdES shall always create a new archive manifest with the same name, while moving the last existing archive manifest.- Specified by:
getArchiveManifestFilename
in interfaceASiCWithCAdESFilenameFactory
- Overrides:
getArchiveManifestFilename
in classDefaultASiCWithCAdESFilenameFactory
- Parameters:
asicContent
-ASiCContent
representing a content of an ASiC container- Returns:
String
manifest filename
-
setArchiveManifestFilename
Sets a new filename for the last archive manifest document (when applicable)- Parameters:
archiveManifestFilename
-String
-
getDataPackageFilename
Description copied from interface:ASiCWithCAdESFilenameFactory
Returns a name of a ZIP archive containing signed documents in case of an ASiC-E signature, when applicable- Specified by:
getDataPackageFilename
in interfaceASiCWithCAdESFilenameFactory
- Overrides:
getDataPackageFilename
in classDefaultASiCWithCAdESFilenameFactory
- Parameters:
asicContent
-ASiCContent
representing a content of an ASiC container- Returns:
String
data package filename
-
setDataPackageFilename
Sets a filename for a new ZIP data package (when applicable)- Parameters:
dataPackageFilename
-String
-
getValidSignatureFilename
This method returns a valid signature filename- Parameters:
signatureFilename
-String
defined signature filenameasicContent
-ASiCContent
- Returns:
String
signature filename
-
getValidTimestampFilename
This method returns a valid timestamp filename- Parameters:
timestampFilename
-String
defined timestamp filenameasicContent
-ASiCContent
- Returns:
String
timestamp filename
-
getValidManifestFilename
This method returns a valid manifest filename- Parameters:
manifestFilename
-String
defined manifest filenameasicContent
-ASiCContent
- Returns:
String
manifest filename
-
getValidArchiveManifestFilename
protected String getValidArchiveManifestFilename(String archiveManifestFilename, ASiCContent asicContent) This method returns a valid archive manifest filename. NOTE: The name of the timestamp file shall be: - ASiC-E with CAdES : "META-INF/ASiCArchiveManifest*.xml". "META-INF/" is optional.- Parameters:
archiveManifestFilename
-String
defined archive manifest filenameasicContent
-ASiCContent
- Returns:
String
archive manifest filename
-