public abstract class SignatureExplorer
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 byte[] |
signatureFileContent |
protected boolean |
validate |
Constructor and Description |
---|
SignatureExplorer(RestPkiClient client) |
Modifier and Type | Method and Description |
---|---|
protected com.lacunasoftware.restpki.OpenSignatureRequestModel |
getRequest(java.lang.String fileMimeType) |
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(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 byte[] signatureFileContent
protected boolean validate
protected java.lang.String defaultSignaturePolicyId
protected SignaturePolicyCatalog acceptableExplicitPolicies
protected java.lang.String securityContextId
public SignatureExplorer(RestPkiClient client)
public void setSignatureFile(byte[] content)
content
- Binary content of the signature filepublic void setSignatureFile(java.lang.String path) throws java.io.IOException
path
- File path of the signature file to be signed.java.io.IOException
- if an error occurs while reading the file.public void setSignatureFile(java.nio.file.Path path) throws java.io.IOException
path
- File path of the signature file to be opened.java.io.IOException
- if an error occurs while reading the file.public 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 getRequest(java.lang.String fileMimeType)