public abstract class SignatureExplorer2
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected SignaturePolicyCatalog |
acceptableExplicitPolicies |
protected RestPkiClient |
client |
protected java.lang.String |
defaultSignaturePolicyId |
protected java.lang.String |
securityContextId |
protected boolean |
validate |
Constructor and Description |
---|
SignatureExplorer2(RestPkiClient client)
Create a new instance using the given RestPkiClient.
|
Modifier and Type | Method and Description |
---|---|
protected com.lacunasoftware.restpki.OpenSignatureRequestModel |
fillRequest(com.lacunasoftware.restpki.OpenSignatureRequestModel request) |
void |
setAcceptableExplicitPolicies(SignaturePolicyCatalog policyCatalog)
Sets the "catalog" of explicit policies that should be accepted when validating signatures with an explicit
validation policy attribute.
|
void |
setDefaultSignaturePolicy(SignaturePolicy signaturePolicy)
Sets the default signature policy to be used to validate signatures.
|
void |
setSecurityContext(SecurityContext securityContext)
Sets the security context to be used to validate the signatures.
|
void |
setSignatureFile(byte[] content)
Sets the signature file to be opened
|
void |
setSignatureFile(FileResult fileResult)
Sets the signature to be signed from a file result from a previous call to Rest PKI
|
void |
setSignatureFile(java.io.InputStream stream)
Sets the PDF to be signed via a stream object
|
void |
setSignatureFile(java.nio.file.Path path)
Sets the file path of the signature file to be opened
|
void |
setSignatureFile(java.lang.String path)
Sets the file path of the signature file to be opened
|
void |
setValidate(boolean validate)
Sets whether the signature file should be validated or just opened
|
protected RestPkiClient client
protected boolean validate
protected java.lang.String securityContextId
protected java.lang.String defaultSignaturePolicyId
protected SignaturePolicyCatalog acceptableExplicitPolicies
public SignatureExplorer2(RestPkiClient client)
client
- the RestPkiClient which shall be used.public void setSignatureFile(java.lang.String path)
path
- File path of the signature file to be signed.public void setSignatureFile(java.nio.file.Path path)
path
- File path of the signature file to be opened.public void setSignatureFile(java.io.InputStream stream)
stream
- a pre-opened InputStream linked to the PDF that will be signed. The stream is NOT closed by this
method.public void setSignatureFile(byte[] content)
content
- Binary content of the signature filepublic void setSignatureFile(FileResult fileResult)
fileResult
- FileResult from previous call to Rest PKIpublic void setValidate(boolean validate)
validate
- Whether to validate the signature file or notpublic void setDefaultSignaturePolicy(SignaturePolicy signaturePolicy)
signaturePolicy
- The default signature policy for validation. Depending on the policy, it might also be
necessary to set a security context.public void setAcceptableExplicitPolicies(SignaturePolicyCatalog policyCatalog)
policyCatalog
- The signature policy catalog (for instance, SignaturePolicyCatalog.getPkiBrazilCades() or
SignaturePolicyCatalog.getPkiBrazilPades())public void setSecurityContext(SecurityContext securityContext)
securityContext
- The security context to be used to validate the signatures on the signature file.protected com.lacunasoftware.restpki.OpenSignatureRequestModel fillRequest(com.lacunasoftware.restpki.OpenSignatureRequestModel request) throws RestException, java.io.IOException
RestException
java.io.IOException