public class CadesSignatureExplorer extends SignatureExplorer
By default, the signature file is only opened but not validated. In order to validate the file, you must call the method setValidate and also the methods regarding signature policies, which specify the parameters for the validation.
CAdES signature files may or may not have embedded the original file that was signed (the "data file"), which is called having an "encapsulated content". Files with the original file embedded are called "attached signatures", whereas files without it are called "detached signatures". This class supports both kinds of files. However, when opening detached signatures, it is necessary to provide not only the CAdES signature file but also the data file.
Implementation notice: when opening detached signatures, the data file is not uploaded to Rest PKI, only its digest(s), which allows for efficient opening of detached CAdES signatures from very large data files.
acceptableExplicitPolicies, client, defaultSignaturePolicyId, securityContextId, signatureFileContent, validate
Constructor and Description |
---|
CadesSignatureExplorer(RestPkiClient client) |
Modifier and Type | Method and Description |
---|---|
CadesSignature |
open()
Performs the open signature operation.
|
void |
setDataFile(java.io.InputStream stream)
Sets the data file input stream (needed only for signatures without encapsulated content, aka "detached signatures")
|
void |
setDataFile(java.nio.file.Path path)
Sets the data file path (needed only for signatures without encapsulated content, aka "detached signatures")
|
void |
setDataFile(java.lang.String path)
Sets the data file path (needed only for signatures without encapsulated content, aka "detached signatures")
|
getRequest, setAcceptableExplicitPolicies, setDefaultSignaturePolicy, setSecurityContext, setSignatureFile, setSignatureFile, setSignatureFile, setValidate
public CadesSignatureExplorer(RestPkiClient client)
public void setDataFile(java.lang.String path)
path
- File path of the data file.public void setDataFile(java.nio.file.Path path)
path
- File path of the data file.public void setDataFile(java.io.InputStream stream)
stream
- InputStream associated with the data file.public CadesSignature open() throws RestException, java.io.IOException
RestException
- if an error occurs when calling REST PKIjava.io.IOException