public interface Container extends Serializable
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.
Modifier and Type | Interface and Description |
---|---|
static class |
Container.DocumentType
Document types
|
Modifier and Type | Method and Description |
---|---|
void |
addDataFile(DataFile dataFile)
Adds the specified data file to the container.
|
DataFile |
addDataFile(File file,
String mimeType)
Adds a data file from the file system to the container.
|
DataFile |
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).
|
DataFile |
addDataFile(String path,
String mimeType)
Adds a data file from the file system 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 SignatureProfile
|
void |
extendSignatureProfile(SignatureProfile profile,
List<Signature> signaturesToExtend)
Extends profile of selected signatures to SignatureProfile
|
Configuration |
getConfiguration()
Gets Configuration
|
List<DataFile> |
getDataFiles()
Returns the list of data files in the container.
|
List<Signature> |
getSignatures()
Returns the list of signatures in the container.
|
default List<Timestamp> |
getTimestamps()
Returns the list of timestamp tokens that cover the contents of this container.
|
DataFile |
getTimeStampToken()
Deprecated.
Deprecated for removal. Use
getTimestamps() instead. |
String |
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 container
|
void |
removeTimestamp(Timestamp timestamp)
Removes the specified timestamp token from this container.
|
void |
save(OutputStream out)
Saves the container to the java.io.OutputStream.
|
File |
saveAsFile(String filePath)
Saves the container to the specified location.
|
InputStream |
saveAsStream()
Saves the container as a stream.
|
void |
setTimeStampToken(DataFile timeStampToken)
Deprecated.
Deprecated for removal. Use
addTimestamp(Timestamp) instead. |
ContainerValidationResult |
validate()
Validate container
|
DataFile addDataFile(String path, String mimeType)
Note: Data files can be added to a container only after all signatures have been removed.
path
- data file to be added to the containermimeType
- MIME type of the data file, for example 'text/plain' or 'application/msword'DataFile addDataFile(InputStream is, String fileName, String mimeType)
Note: Data files can be added to a container only after all signatures have been removed.
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'DataFile addDataFile(File file, String mimeType)
Note: Data files can be added to a container only after all signatures have been removed.
file
- data file to be added to the containermimeType
- MIME type of the data file, for example 'text/plain' or 'application/msword'void addDataFile(DataFile dataFile)
Note: Data files can be added to a container only after all signatures have been removed.
dataFile
- data file to be added to the containervoid addSignature(Signature signature)
signature
- signature to be added.void addTimestamp(Timestamp timestamp)
timestamp
- timestamp to add to this containerList<DataFile> getDataFiles()
String getType()
List<Signature> getSignatures()
default List<Timestamp> getTimestamps()
void removeDataFile(DataFile file)
Note: Data files can be removed from a container only after all signatures have been removed.
file
- data file to be removed from the container.void removeSignature(Signature signature)
signature
- signature to be removed.void removeTimestamp(Timestamp timestamp)
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.
timestamp
- timestamp token to remove from this containervoid extendSignatureProfile(SignatureProfile profile)
profile
- signature profileSignatureProfile
void extendSignatureProfile(SignatureProfile profile, List<Signature> signaturesToExtend)
profile
- signature profilesignaturesToExtend
- signatures selected for extensionSignatureProfile
File saveAsFile(String filePath)
filePath
- file name and path.InputStream saveAsStream()
void save(OutputStream out)
out
- output stream.OutputStream
ContainerValidationResult validate()
@Deprecated void setTimeStampToken(DataFile timeStampToken)
addTimestamp(Timestamp)
instead.timeStampToken
- timestamp token@Deprecated DataFile getTimeStampToken()
getTimestamps()
instead.Configuration getConfiguration()
Copyright © 2024. All rights reserved.