public abstract class SignatureStarter2
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
callbackArgument |
protected java.lang.String |
certificateBase64 |
protected RestPkiClient |
client |
protected java.lang.String |
securityContextId |
protected java.lang.String |
signaturePolicyId |
Constructor and Description |
---|
SignatureStarter2(RestPkiClient client)
Create a new instance using the given RestPkiClient.
|
Modifier and Type | Method and Description |
---|---|
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 certificateBase64)
Deprecated.
Alias for the setSignerCertificateBase64 method.
|
void |
setSignerCertificateBase64(java.lang.String certificateBase64)
Sets the signer's certificate, encoded in Base64.
|
void |
setSignerCertificateRaw(byte[] certificateRaw)
Sets the signer's certificate.
|
abstract SignatureStartResult |
start()
Performs the first step, should be called after setting the necessary parameters.
|
abstract SignatureStartWithWebPkiResult |
startWithWebPki()
Performs the first step, should be called after setting the necessary parameters.
|
protected RestPkiClient client
protected java.lang.String certificateBase64
protected java.lang.String signaturePolicyId
protected java.lang.String securityContextId
protected java.lang.String callbackArgument
public SignatureStarter2(RestPkiClient client)
client
- the RestPkiClient which shall be used.public void setSignerCertificateRaw(byte[] certificateRaw)
certificateRaw
- The signer's certificate. If you're using the Web PKI component on the client-side, this
is the format given by the component.public void setSignerCertificateBase64(java.lang.String certificateBase64)
certificateBase64
- 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 setSignerCertificate(java.lang.String certificateBase64)
certificateBase64
- 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 SignatureStartResult start() throws RestException, java.io.IOException
RestException
- if an error occurs when calling REST PKI.java.io.IOException
- if an error occurs when trying to obtain the file to be signed or be cosign or when trying
to compute all hashes from this file, both files had to be provided before this method is called.public abstract SignatureStartWithWebPkiResult startWithWebPki() throws RestException, java.io.IOException
RestException
- if an error occurs when calling REST PKI.java.io.IOException
- if an error occurs when trying to obtain the file to be signed or be cosign or when trying
to compute all hashes from this file, both files had to be provided before this method is called.