Package org.digidoc4j.impl.pades
Class PadesContainer
java.lang.Object
eu.europa.esig.dss.pdf.AbstractPdfObjFactory
eu.europa.esig.dss.pdf.pdfbox.PdfBoxDefaultObjectFactory
org.digidoc4j.impl.pades.PadesContainer
- All Implemented Interfaces:
eu.europa.esig.dss.pdf.IPdfObjFactory
,Serializable
,Container
public class PadesContainer
extends eu.europa.esig.dss.pdf.pdfbox.PdfBoxDefaultObjectFactory
implements Container
Created by Andrei on 17.11.2017.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.digidoc4j.Container
Container.DocumentType
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddDataFile
(File file, String mimeType) Adds a data file from the file system to the container.addDataFile
(InputStream is, String fileName, String mimeType) Adds a data file from the input stream (i.e. the date file content can be read from the internal memory buffer).addDataFile
(String path, String mimeType) Adds a data file from the file system to the container.void
addDataFile
(DataFile dataFile) Adds the specified data file to the container.void
addSignature
(Signature signature) Adds a new signature to the container.void
addTimestamp
(Timestamp timestamp) Adds a new timestamp token covering the contents of this container.void
extendSignatureProfile
(SignatureProfile profile) Extends profile of all signatures to SignatureProfilevoid
extendSignatureProfile
(SignatureProfile profile, List<Signature> signaturesToExtend) Extends profile of selected signatures to SignatureProfileGets ConfigurationReturns the list of data files in the container.Returns the list of signatures in the container.Deprecated.getType()
Returns the type of the container.void
removeDataFile
(DataFile file) Removes the data file from the container.void
removeSignature
(Signature signature) Removes the signature from the containervoid
removeTimestamp
(Timestamp timestamp) Removes the specified timestamp token from this container.void
save
(OutputStream out) Saves the container to the java.io.OutputStream.saveAsFile
(String filePath) Saves the container to the specified location.Saves the container as a stream.void
setTimeStampToken
(DataFile timeStampToken) Deprecated.validate()
Validate pades containerMethods inherited from class eu.europa.esig.dss.pdf.pdfbox.PdfBoxDefaultObjectFactory
newArchiveTimestampService, newContentTimestampService, newPAdESSignatureService, newSignatureTimestampService
Methods inherited from class eu.europa.esig.dss.pdf.AbstractPdfObjFactory
setPdfDifferencesFinder, setPdfObjectModificationsFinder, setPdfPermissionsChecker, setPdfSignatureFieldPositionChecker, setResourcesHandlerBuilder
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.digidoc4j.Container
getTimestamps
-
Field Details
-
PADES
Deprecated.Deprecated for removal. UseConstant.PADES_CONTAINER_TYPE
instead.- See Also:
-
-
Constructor Details
-
PadesContainer
- Parameters:
configuration
- configuration contextcontainerPath
- the path of container
-
-
Method Details
-
addDataFile
Description copied from interface:Container
Adds a data file from the file system to the container.Note: Data files can be added to a container only after all signatures have been removed.
- Specified by:
addDataFile
in interfaceContainer
- Parameters:
path
- data file to be added to the containermimeType
- MIME type of the data file, for example 'text/plain' or 'application/msword'- Returns:
- data file
-
addDataFile
Description copied from interface:Container
Adds a data file from the input stream (i.e. the date file content can be read from the internal memory buffer).Note: Data files can be added to a container only after all signatures have been removed.
- Specified by:
addDataFile
in interfaceContainer
- Parameters:
is
- input stream from where data is readfileName
- data file name in the containermimeType
- MIME type of the data file, for example 'text/plain' or 'application/msword'- Returns:
- data file
-
addDataFile
Description copied from interface:Container
Adds a data file from the file system to the container.Note: Data files can be added to a container only after all signatures have been removed.
- Specified by:
addDataFile
in interfaceContainer
- Parameters:
file
- data file to be added to the containermimeType
- MIME type of the data file, for example 'text/plain' or 'application/msword'- Returns:
- data file
-
addDataFile
Description copied from interface:Container
Adds the specified data file to the container.Note: Data files can be added to a container only after all signatures have been removed.
- Specified by:
addDataFile
in interfaceContainer
- Parameters:
dataFile
- data file to be added to the container
-
addSignature
Description copied from interface:Container
Adds a new signature to the container.- Specified by:
addSignature
in interfaceContainer
- Parameters:
signature
- signature to be added.
-
getDataFiles
Description copied from interface:Container
Returns the list of data files in the container.- Specified by:
getDataFiles
in interfaceContainer
- Returns:
- list of data files in the container
-
getType
Description copied from interface:Container
Returns the type of the container. The known container types are the following: Custom implementations of this interface may return other custom types. -
getSignatures
Description copied from interface:Container
Returns the list of signatures in the container.- Specified by:
getSignatures
in interfaceContainer
- Returns:
- list of signatures in the container
-
removeDataFile
Description copied from interface:Container
Removes the data file from the container.Note: Data files can be removed from a container only after all signatures have been removed.
- Specified by:
removeDataFile
in interfaceContainer
- Parameters:
file
- data file to be removed from the container.
-
removeSignature
Description copied from interface:Container
Removes the signature from the container- Specified by:
removeSignature
in interfaceContainer
- Parameters:
signature
- signature to be removed.
-
extendSignatureProfile
Description copied from interface:Container
Extends profile of all signatures to SignatureProfile- Specified by:
extendSignatureProfile
in interfaceContainer
- Parameters:
profile
- signature profile- See Also:
-
extendSignatureProfile
Description copied from interface:Container
Extends profile of selected signatures to SignatureProfile- Specified by:
extendSignatureProfile
in interfaceContainer
- Parameters:
profile
- signature profilesignaturesToExtend
- signatures selected for extension- See Also:
-
saveAsFile
Description copied from interface:Container
Saves the container to the specified location.- Specified by:
saveAsFile
in interfaceContainer
- Parameters:
filePath
- file name and path.
-
saveAsStream
Description copied from interface:Container
Saves the container as a stream.- Specified by:
saveAsStream
in interfaceContainer
- Returns:
- stream of the container.
-
validate
Validate pades container -
addTimestamp
Description copied from interface:Container
Adds a new timestamp token covering the contents of this container.- Specified by:
addTimestamp
in interfaceContainer
- Parameters:
timestamp
- timestamp to add to this container
-
removeTimestamp
Description copied from interface:Container
Removes the specified timestamp token from this container.Note: A timestamp token can be removed from a container only if the container does not contain any other timestamp tokens that cover the timestamp token to be removed.
- Specified by:
removeTimestamp
in interfaceContainer
- Parameters:
timestamp
- timestamp token to remove from this container
-
setTimeStampToken
Deprecated.Description copied from interface:Container
Adds timestamp token- Specified by:
setTimeStampToken
in interfaceContainer
- Parameters:
timeStampToken
- timestamp token
-
getTimeStampToken
Deprecated.Description copied from interface:Container
Returns timestamp token- Specified by:
getTimeStampToken
in interfaceContainer
- Returns:
- TimestampToken
-
getConfiguration
Description copied from interface:Container
Gets Configuration- Specified by:
getConfiguration
in interfaceContainer
- Returns:
- Configuration
-
save
Description copied from interface:Container
Saves the container to the java.io.OutputStream.
-