Interface Container
- All Superinterfaces:
Serializable
- All Known Subinterfaces:
CompositeContainer
- All Known Implementing Classes:
AsicContainer
,AsicEContainer
,AsicSCompositeContainer
,AsicSContainer
,BDocContainer
,DDocContainer
,PadesContainer
A container can contain several files and all those files can be signed using signing certificates. A container can only be signed if it contains data files.
Data files can be added and removed from a container only if the container is not signed. To modify the data list of a signed container by adding or removing datafiles you must first remove all the signatures.
-
Nested Class Summary
Nested Classes -
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.Returns the list of timestamp tokens that cover the contents of this container.Deprecated.Deprecated for removal.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.Deprecated for removal.validate()
Validate container
-
Method Details
-
addDataFile
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.
- 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
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.
- 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
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.
- 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
Adds the specified data file to the container.Note: Data files can be added to a container only after all signatures have been removed.
- Parameters:
dataFile
- data file to be added to the container
-
addSignature
Adds a new signature to the container.- Parameters:
signature
- signature to be added.
-
addTimestamp
Adds a new timestamp token covering the contents of this container.- Parameters:
timestamp
- timestamp to add to this container
-
getDataFiles
Returns the list of data files in the container.- Returns:
- list of data files in the container
-
getType
String getType()Returns the type of the container. The known container types are the following: Custom implementations of this interface may return other custom types.- Returns:
- type of the container
-
getSignatures
Returns the list of signatures in the container.- Returns:
- list of signatures in the container
-
getTimestamps
Returns the list of timestamp tokens that cover the contents of this container.- Returns:
- list of timestamp tokens in this container
-
removeDataFile
Removes the data file from the container.Note: Data files can be removed from a container only after all signatures have been removed.
- Parameters:
file
- data file to be removed from the container.
-
removeSignature
Removes the signature from the container- Parameters:
signature
- signature to be removed.
-
removeTimestamp
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.
- Parameters:
timestamp
- timestamp token to remove from this container
-
extendSignatureProfile
Extends profile of all signatures to SignatureProfile- Parameters:
profile
- signature profile- See Also:
-
extendSignatureProfile
Extends profile of selected signatures to SignatureProfile- Parameters:
profile
- signature profilesignaturesToExtend
- signatures selected for extension- See Also:
-
saveAsFile
Saves the container to the specified location.- Parameters:
filePath
- file name and path.
-
saveAsStream
InputStream saveAsStream()Saves the container as a stream.- Returns:
- stream of the container.
-
save
Saves the container to the java.io.OutputStream.- Parameters:
out
- output stream.- See Also:
-
validate
ContainerValidationResult validate()Validate container- Returns:
- validation result
-
setTimeStampToken
Deprecated.Deprecated for removal. UseaddTimestamp(Timestamp)
instead.Adds timestamp token- Parameters:
timeStampToken
- timestamp token
-
getTimeStampToken
Deprecated.Deprecated for removal. UsegetTimestamps()
instead.Returns timestamp token- Returns:
- TimestampToken
-
getConfiguration
Configuration getConfiguration()Gets Configuration- Returns:
- Configuration
-