Class SignRequestData

java.lang.Object
se.idsec.signservice.integration.SignRequestData
All Implemented Interfaces:
Serializable, Extensible

public class SignRequestData extends Object implements Extensible
Domain class representing the result of a SignServiceIntegrationService.createSignRequest(SignRequestInput) call. This class holds the information needed to send a dss:SignRequest to a signature service.

Chapter 3 of Implementation Profile for using OASIS DSS in Central Signing Services describes how a sign request is transfered to the signature service. Below is an example of an XHTML form:

 
 <?xml version='1.0' encoding='UTF-8'?>
 <!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.1//EN' 'http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd'>
 <html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en'>
 <body onload='document.forms[0].submit()'>
   <noscript>
     <p><strong>Note:</strong> Since your browser does not support JavaScript,
     you must press the Continue button once to proceed.</p>
   </noscript>
   <form action='https://sig.example.com/signrequest' method='post'>
     <input type='hidden' name='Binding' value='POST/XML/1.0'/>
     <input type='hidden' name='RelayState' value='56345145a482995d'/>
     <input type='hidden' name='EidSignRequest' value='PD94bWC...WVzdD4='/>
     <noscript>
       <input type='submit' value='Continue'/>
     </noscript>
   </form>
 </body>
 
Author:
Martin Lindström (martin@idsec.se), Stefan Santesson (stefan@idsec.se)
See Also:
  • Field Details

  • Constructor Details

    • SignRequestData

      public SignRequestData()
      Default constructor.
    • SignRequestData

      public SignRequestData(SignatureState state, String signRequest, String relayState, String binding, String destinationUrl, Extension extension)
      Constructor.
      Parameters:
      state - state for a signature operation
      signRequest - the Base64-encoded SignRequest message that is to be posted to the signature service
      relayState - the relay state
      binding - the identifier for the binding of the message that is to be sent
      destinationUrl - the signature service URL to which the SignRequest should be posted
      extension - extensions for the object
  • Method Details

    • getState

      public SignatureState getState()
      Gets the state for a signature operation.

      This state must be maintained by the signature requester and when a sign response has been received from the signature service be supplied in the SignServiceIntegrationService.processSignResponse(String, String, SignatureState, SignResponseProcessingParameters) call.

      Returns:
      the signature state for this operation
    • setState

      public void setState(SignatureState state)
      Assigns the state for a signature operation.

      This state must be maintained by the signature requester and when a sign response has been received from the signature service be supplied in the SignServiceIntegrationService.processSignResponse(String, String, SignatureState, SignResponseProcessingParameters) call.

      Parameters:
      state - the signature state
    • getSignRequest

      public String getSignRequest()
      Gets the Base64-encoded SignRequest message that is to be posted to the signature service.

      This value should be posted to the signature service in a form where the parameter has the name EidSignRequest. See example above.

      Returns:
      the encoded SignRequest message
    • setSignRequest

      public void setSignRequest(String signRequest)
      Assigns the Base64-encoded SignRequest message that is to be posted to the signature service.

      This value should be posted to the signature service in a form where the parameter has the name EidSignRequest. See example above.

      Parameters:
      signRequest - the sign request (in Base64-encoding)
    • getRelayState

      public String getRelayState()
      Gets the relay state. This is the same value as the RequestID attribute of the SignRequest and SignatureState.getId().

      This value should be posted to the signature service in a form where the parameter has the name RelayState. See example above.

      Note: The RelayState used in communication with the signature service has the same name as the parameter used in SAML authentication requests, but in SAML the value is opaque and does not bind to any value in the request as is the case for signature service communication. An unlucky re-use of the term RelayState.

      Returns:
      the relay state value
    • setRelayState

      public void setRelayState(String relayState)
      Assigns the relay state.

      See getRelayState() for clarifications about the relay state.

      Parameters:
      relayState - the relay state variable
    • getBinding

      public String getBinding()
      Gets the identifier for the binding of the message that is to be sent.

      This value should be posted to the signature service in a form where the parameter has the name Binding. See example above.

      Currently, the only supported value is "POST/XML/1.0".

      Returns:
      the binding identifier
    • setBinding

      public void setBinding(String binding)
      Assigns the identifier for the binding of the message that is to be sent.

      The default value is "POST/XML/1.0".

      Parameters:
      binding - the binding identifier
    • getDestinationUrl

      public String getDestinationUrl()
      Gets the signature service URL to which the SignRequest should be posted.
      Returns:
      signature service destination URL
    • setDestinationUrl

      public void setDestinationUrl(String destinationUrl)
      Assigns the signature service URL to which the SignRequest should be posted.
      Parameters:
      destinationUrl - the signature service URL to which the SignRequest should be posted
    • getExtension

      public Extension getExtension()
      Returns the extension parameters for the instance.
      Specified by:
      getExtension in interface Extensible
      Returns:
      the extension, or null if no extensions are set
    • setExtension

      public void setExtension(Extension extension)
      Assigns the extension parameters for the instance.
      Specified by:
      setExtension in interface Extensible
      Parameters:
      extension - the extension
    • builder

      public static SignRequestData.SignRequestDataBuilder builder()
    • toString

      public String toString()
      Overrides:
      toString in class Object