public class PadesContainer extends eu.europa.esig.dss.pdf.pdfbox.PdfBoxDefaultObjectFactory implements Container
Container.DocumentType
Constructor and Description |
---|
PadesContainer(Configuration configuration,
String containerPath) |
Modifier and Type | Method and Description |
---|---|
void |
addDataFile(DataFile dataFile)
Adds a data file from the file system 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.
|
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 |
extendSignatureProfile(SignatureProfile profile)
Extends signature profile to SignatureProfile
|
Configuration |
getConfiguration()
Gets Configuration
|
List<DataFile> |
getDataFiles()
Returns all data files in the container.
|
List<Signature> |
getSignatures()
Returns a list of all signatures in the container.
|
DataFile |
getTimeStampToken()
Returns timestamp token
|
String |
getType()
Returns container type "BDOC" or "DDOC"
|
void |
removeDataFile(DataFile file)
Removes the data file from the container.
|
void |
removeSignature(Signature signature)
Removes the signature from the 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.
|
ContainerValidationResult |
validate()
Validate pades container
|
newArchiveTimestampService, newContentTimestampService, newPAdESSignatureService, newSignatureTimestampService
public static final String PADES
public PadesContainer(Configuration configuration, String containerPath)
configuration
- configuration contextcontainerPath
- the path of containerpublic DataFile addDataFile(String path, String mimeType)
Container
Note: Data files can be removed from a container only after all signatures have been removed.
addDataFile
in interface Container
path
- data file to be added to the containermimeType
- MIME type of the data file, for example 'text/plain' or 'application/msword'public DataFile addDataFile(InputStream is, String fileName, String mimeType)
Container
Note: Data files can be added to a container only after all signatures have been removed.
addDataFile
in interface Container
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'public DataFile addDataFile(File file, String mimeType)
Container
Note: Data files can be removed from a container only after all signatures have been removed.
addDataFile
in interface Container
file
- data file to be added to the containermimeType
- MIME type of the data file, for example 'text/plain' or 'application/msword'public void addDataFile(DataFile dataFile)
Container
Note: Data files can be removed from a container only after all signatures have been removed.
addDataFile
in interface Container
dataFile
- data file to be added to the containerpublic void addSignature(Signature signature)
Container
addSignature
in interface Container
signature
- signature to be added.public List<DataFile> getDataFiles()
Container
getDataFiles
in interface Container
public String getType()
Container
public List<Signature> getSignatures()
Container
getSignatures
in interface Container
public void removeDataFile(DataFile file)
Container
Note: Data files can be removed from a container only after all signatures have been removed.
removeDataFile
in interface Container
file
- data file to be removed from the container.public void removeSignature(Signature signature)
Container
removeSignature
in interface Container
signature
- signature to be removed.public void extendSignatureProfile(SignatureProfile profile)
Container
extendSignatureProfile
in interface Container
profile
- signature profileSignatureProfile
public File saveAsFile(String filePath)
Container
saveAsFile
in interface Container
filePath
- file name and path.public InputStream saveAsStream()
Container
saveAsStream
in interface Container
public ContainerValidationResult validate()
@Deprecated public void setTimeStampToken(DataFile timeStampToken)
Container
setTimeStampToken
in interface Container
timeStampToken
- timestamp tokenpublic DataFile getTimeStampToken()
Container
getTimeStampToken
in interface Container
public Configuration getConfiguration()
Container
getConfiguration
in interface Container
public void save(OutputStream out)
Container
save
in interface Container
out
- output stream.OutputStream
Copyright © 2024. All rights reserved.