Class DefaultSignRequestProcessor
java.lang.Object
se.idsec.signservice.integration.process.impl.DefaultSignRequestProcessor
- All Implemented Interfaces:
SignRequestProcessor
Default implementation of the
SignRequestProcessor
interface.- Author:
- Martin Lindström (martin@idsec.se), Stefan Santesson (stefan@idsec.se)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Ensures that all required properties have been assigned.protected static XMLGregorianCalendar
getNow()
Returns the current time in XML time format.Gets an unmutable list of installed processors for "to be signed" documents.se.idsec.signservice.integration.SignRequestInput
preProcess
(se.idsec.signservice.integration.SignRequestInput signRequestInput, IntegrationServiceConfiguration config, String callerId) Performs validation of the supplied sign request input against the supplied configuration.process
(se.idsec.signservice.integration.SignRequestInput signRequestInput, String requestID, IntegrationServiceConfiguration config) Processes that sign request input and produces adss:SignRequest
message.void
setDefaultVersion
(String defaultVersion) Assigns the default version to use.void
setDocumentCache
(DocumentCache documentCache) Assigns the document cache to use.void
setSignMessageProcessor
(SignMessageProcessor signMessageProcessor) Assigns the sign message processor to use.void
setTbsDocumentProcessors
(List<TbsDocumentProcessor<?>> tbsDocumentProcessors) Sets the list of TBS document processors.protected Document
signSignRequest
(SignRequestWrapper signRequest, String correlationID, se.swedenconnect.security.credential.PkiCredential signingCredential) Signs the suppliedSignRequest
message.
-
Constructor Details
-
DefaultSignRequestProcessor
public DefaultSignRequestProcessor()Constructor.
-
-
Method Details
-
preProcess
public se.idsec.signservice.integration.SignRequestInput preProcess(se.idsec.signservice.integration.SignRequestInput signRequestInput, IntegrationServiceConfiguration config, String callerId) throws se.idsec.signservice.integration.core.error.InputValidationException Performs validation of the supplied sign request input against the supplied configuration. The returnedSignRequestInput
object is the supplied input updated with default values from the configuration.- Specified by:
preProcess
in interfaceSignRequestProcessor
- Parameters:
signRequestInput
- the sign request inputconfig
- the configuration under which we are processing the requestcallerId
- optional ID for the calling entity- Returns:
- an updated sign request input object where all required fields are filled in
- Throws:
se.idsec.signservice.integration.core.error.InputValidationException
- if validation of the input fails
-
process
public SignRequestProcessingResult process(se.idsec.signservice.integration.SignRequestInput signRequestInput, String requestID, IntegrationServiceConfiguration config) throws se.idsec.signservice.integration.core.error.SignServiceIntegrationException Processes that sign request input and produces adss:SignRequest
message.- Specified by:
process
in interfaceSignRequestProcessor
- Parameters:
signRequestInput
- the validated inputrequestID
- the unique ID for this requestconfig
- configuration- Returns:
- the SignRequest
- Throws:
se.idsec.signservice.integration.core.error.SignServiceIntegrationException
- for processing errors
-
signSignRequest
protected Document signSignRequest(SignRequestWrapper signRequest, String correlationID, se.swedenconnect.security.credential.PkiCredential signingCredential) throws InternalSignServiceIntegrationException Signs the suppliedSignRequest
message.- Parameters:
signRequest
- the SignRequest message to signcorrelationID
- the correlation ID for this operationsigningCredential
- the signing credential to use- Returns:
- a signed document
- Throws:
InternalSignServiceIntegrationException
- for signature errors
-
getTbsDocumentProcessors
Gets an unmutable list of installed processors for "to be signed" documents.- Specified by:
getTbsDocumentProcessors
in interfaceSignRequestProcessor
- Returns:
- the processors for tbsDocuments
-
setTbsDocumentProcessors
Sets the list of TBS document processors.- Parameters:
tbsDocumentProcessors
- the document processors
-
setSignMessageProcessor
Assigns the sign message processor to use.- Parameters:
signMessageProcessor
- the sign message processor
-
setDocumentCache
Assigns the document cache to use.- Parameters:
documentCache
- the document cache
-
setDefaultVersion
Assigns the default version to use. If not set, section 3.1 of "DSS Extension for Federated Central Signing Services" states that version 1.1 is the default. So, if thedefaultVersion
is not set, we don't include the version unless a feature that requires a higher version is used.- Parameters:
defaultVersion
- the version to default to
-
getNow
Returns the current time in XML time format.- Returns:
- the current time
-
afterPropertiesSet
Ensures that all required properties have been assigned.Note: If executing in a Spring Framework environment this method is automatically invoked after all properties have been assigned. Otherwise it should be explicitly invoked.
- Throws:
Exception
- if not all settings are correct
-