Package se.idsec.signservice.integration
Interface SignServiceIntegrationService
- All Known Subinterfaces:
ExtendedSignServiceIntegrationService
public interface SignServiceIntegrationService
Interface describing the API for the SignService Integration Service.
- Author:
- Martin Lindström (martin@idsec.se), Stefan Santesson (stefan@idsec.se)
-
Method Summary
Modifier and TypeMethodDescriptiondefault SignRequestData
createSignRequest
(SignRequestInput signRequestInput) createSignRequest
(SignRequestInput signRequestInput, String callerId) Creates a SignRequest message that is to be posted to the signature service.getConfiguration
(String policy) Given the name of a SignService Integration policy, the method returns the default settings used for this policy.Returns a list of names of the policies that are defined for this instance of the SignService Integration Service.default String
Returns the version identifier for the current version of the SignService Integration Service.default SignatureResult
processSignResponse
(String signResponse, String relayState, SignatureState state, SignResponseProcessingParameters parameters) processSignResponse
(String signResponse, String relayState, SignatureState state, SignResponseProcessingParameters parameters, String callerId) When the service that has ordered the signing operation receives the sign response message it should invoke this method to process this response.
-
Method Details
-
createSignRequest
@Nonnull SignRequestData createSignRequest(@Nonnull SignRequestInput signRequestInput, @Nullable String callerId) throws InputValidationException, SignServiceIntegrationException Creates a SignRequest message that is to be posted to the signature service.- Parameters:
signRequestInput
- the requirements and input for how to create the SignRequestcallerId
- the identity for the calling entity (only needed if the implementation is a stand-alone service running in stateful mode)- Returns:
- a SignRequestData object containing the encoded (and signed) SignRequest along with additional parameters
- Throws:
InputValidationException
- for errors in the supplied inputSignServiceIntegrationException
- for errors creating the SignRequest
-
createSignRequest
@Nonnull default SignRequestData createSignRequest(@Nonnull SignRequestInput signRequestInput) throws InputValidationException, SignServiceIntegrationException - Parameters:
signRequestInput
- the requirements and input for how to create the SignRequest- Returns:
- a SignRequestData object containing the encoded (and signed) SignRequest along with additional parameters
- Throws:
InputValidationException
- for errors in the supplied inputSignServiceIntegrationException
- for errors creating the SignRequest
-
processSignResponse
@Nonnull SignatureResult processSignResponse(@Nonnull String signResponse, @Nonnull String relayState, @Nonnull SignatureState state, @Nullable SignResponseProcessingParameters parameters, @Nullable String callerId) throws SignResponseCancelStatusException, SignResponseErrorStatusException, SignServiceIntegrationException When the service that has ordered the signing operation receives the sign response message it should invoke this method to process this response. The processing will validate the signature of each signed document and return the signed document(s) along with metadata about the signature process.Note: The
relayState
must be equal to supplied state (SignatureState.getId()
). This parameter is redundant, but included for pedagogical reasons since the RelayState POST parameter is received.- Parameters:
signResponse
- the Base64-encoded SignResponse message (from the EidSignResponse POST parameter)relayState
- the relayState (from the RelayState POST parameter)state
- the signature stateparameters
- optional processing parameter giving directives about the processingcallerId
- the identity for the calling entity (only needed if the implementation is a stand-alone service running in stateful mode)- Returns:
- a SignatureResult object containing the signed documents and metadata about the signature
- Throws:
SignResponseCancelStatusException
- the sign service reported that the user cancelled the operationSignResponseErrorStatusException
- the sign service reported an errorSignServiceIntegrationException
- for validation and processing errors
-
processSignResponse
@Nonnull default SignatureResult processSignResponse(@Nonnull String signResponse, @Nonnull String relayState, @Nonnull SignatureState state, @Nullable SignResponseProcessingParameters parameters) throws SignResponseCancelStatusException, SignResponseErrorStatusException, SignServiceIntegrationException - Parameters:
signResponse
- the Base64-encoded SignResponse message (from the EidSignResponse POST parameter)relayState
- the relayState (from the RelayState POST parameter)state
- the signature stateparameters
- optional processing parameter giving directives about the processing- Returns:
- a SignatureResult object containing the signed documents and metadata about the signature
- Throws:
SignResponseCancelStatusException
- the sign service reported that the user cancelled the operationSignResponseErrorStatusException
- the sign service reported an errorSignServiceIntegrationException
- for validation and processing errors
-
getConfiguration
@Nonnull IntegrationServiceDefaultConfiguration getConfiguration(@Nullable String policy) throws PolicyNotFoundException Given the name of a SignService Integration policy, the method returns the default settings used for this policy.- Parameters:
policy
- the policy name (null is interpreted as the default policy)- Returns:
- the default service configuration for the given policy
- Throws:
PolicyNotFoundException
- if the given policy does not exist
-
getPolicies
Returns a list of names of the policies that are defined for this instance of the SignService Integration Service.- Returns:
- a non-empty list of policy names
-
getVersion
Returns the version identifier for the current version of the SignService Integration Service.- Returns:
- version string
-