public abstract class SignatureStarter
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
callbackArgument |
protected java.lang.String |
certificate |
protected PKCertificate |
certificateInfo |
protected RestPkiClient |
client |
protected boolean |
done |
protected java.lang.String |
securityContextId |
protected java.lang.String |
signaturePolicyId |
Constructor and Description |
---|
SignatureStarter(RestPkiClient client)
Create a new instance using the given RestPkiClient.
|
Modifier and Type | Method and Description |
---|---|
PKCertificate |
getCertificateInfo()
If the signer's certificate was given, this method returns its information (can only be called after calling the
start() or startWithWebPki() methods).
|
void |
setCallbackArgument(java.lang.String argument)
Optional, sets a callback argument that will be returned on the second step.
|
void |
setSecurityContext(SecurityContext securityContext)
Sets the security context to be used to validate the signature.
|
void |
setSignaturePolicy(SignaturePolicy signaturePolicy)
Sets the signature policy to be used for the signature.
|
void |
setSignerCertificate(java.lang.String certificate)
Sets the signer's certificate.
|
abstract ClientSideSignatureInstructions |
start()
Performs the first step, should be called after setting the necessary parameters.
|
abstract java.lang.String |
startWithWebPki()
Performs the first step, should be called after setting the necessary parameters.
|
protected RestPkiClient client
protected java.lang.String certificate
protected java.lang.String signaturePolicyId
protected java.lang.String securityContextId
protected java.lang.String callbackArgument
protected boolean done
protected PKCertificate certificateInfo
public SignatureStarter(RestPkiClient client)
client
- the RestPkiClient which shall be used.public void setSignerCertificate(java.lang.String certificate)
certificate
- The signer's certificate, encoded in Base64. If you're using the Web PKI component on
the client-side, this is the format given by the component.public void setSignaturePolicy(SignaturePolicy signaturePolicy)
signaturePolicy
- The signature policy. Depending on the policy, it might also be necessary to set
a security context.public void setSecurityContext(SecurityContext securityContext)
securityContext
- The security context to be used to validate the signature.public void setCallbackArgument(java.lang.String argument)
The callback argument can be used to simplify the code of the client application. For instance, it might be the ID of the document being signed.
As the PDf content, the callback argument is also stored in the server with AES-128 encryption using a key which is never stored by the server, therefore it cannot read the value on its own, protecting it against compromise even in the event of a complete data leakage.
argument
- The callback argument, a string whose UTF-8 encoding must not exceed 200 bytes.public abstract ClientSideSignatureInstructions start() throws RestException
RestException
- if an error occurs when calling REST PKIpublic abstract java.lang.String startWithWebPki() throws RestException
RestException
- if an error occurs when calling REST PKIpublic PKCertificate getCertificateInfo()