public class DetachedResourceXmlSignatureStarter extends XmlSignatureStarter
Note on confidentiality: the XML for the signature and the resource content are stored on the server between the first and second steps, but never unencrypted. The content is encrypted using AES-128 and the key is not stored on the server, it is instead mixed into the token that is returned and which is necessary on the second step. In other words, the server stores the XML and the resource content but is unable to read it on its own, therefore the XML contents cannot be compromised, even in the event of a complete data leakage.
signatureElementId, signatureElementLocation, xml
callbackArgument, certificate, certificateInfo, client, done, securityContextId, signaturePolicyId
Constructor and Description |
---|
DetachedResourceXmlSignatureStarter(RestPkiClient client)
Create a new instance using the given RestPkiClient.
|
Modifier and Type | Method and Description |
---|---|
void |
SetToSignDetachedResource(byte[] resourceContent,
java.lang.String resourceUri)
Sets the detached resource to be signed
|
void |
SetToSignDetachedResource(java.nio.file.Path resourcePath,
java.lang.String resourceUri)
Sets the detached resource to be signed
|
void |
SetToSignDetachedResource(java.lang.String resourcePath,
java.lang.String resourceUri)
Sets the detached resource to be signed
|
ClientSideSignatureInstructions |
start()
Performs the first step, should be called after setting the necessary parameters.
|
java.lang.String |
startWithWebPki()
Performs the first step, should be called after setting the necessary parameters.
|
setSignatureElementId, setSignatureElementLocation, setXml, setXml, setXml, setXml
getCertificateInfo, setCallbackArgument, setSecurityContext, setSignaturePolicy, setSignerCertificate
public DetachedResourceXmlSignatureStarter(RestPkiClient client)
client
- the RestPkiClient which shall be used.public void SetToSignDetachedResource(byte[] resourceContent, java.lang.String resourceUri)
resourceContent
- The resource bytesresourceUri
- The resource URIpublic void SetToSignDetachedResource(java.lang.String resourcePath, java.lang.String resourceUri) throws java.io.IOException
resourcePath
- The resource pathresourceUri
- The resource URIjava.io.IOException
public void SetToSignDetachedResource(java.nio.file.Path resourcePath, java.lang.String resourceUri) throws java.io.IOException
resourcePath
- The resource pathresourceUri
- The resource URIjava.io.IOException
public ClientSideSignatureInstructions start() throws RestException
start
in class SignatureStarter
RestException
- if an error occurs when calling REST PKIpublic java.lang.String startWithWebPki() throws RestException
startWithWebPki
in class SignatureStarter
RestException
- if an error occurs when calling REST PKI