Interface TbsDocumentProcessor<T>

Type Parameters:
T - the type of documents handled by this processor
All Superinterfaces:
DocumentProcessor<T>
All Known Implementing Classes:
AbstractTbsDocumentProcessor

public interface TbsDocumentProcessor<T> extends DocumentProcessor<T>
Interface for a processor of a "to be signed" document.
Author:
Martin Lindström (martin@idsec.se), Stefan Santesson (stefan@idsec.se)
  • Method Details

    • supports

      boolean supports(@Nonnull se.idsec.signservice.integration.document.TbsDocument document)
      Predicate that tells if the supplied document can be handled by this processor.
      Parameters:
      document - the document
      Returns:
      if the document can be processed by this instance true is returned, otherwise false
    • preProcess

      ProcessedTbsDocument preProcess(se.idsec.signservice.integration.document.TbsDocument document, se.idsec.signservice.integration.SignRequestInput signRequestInput, IntegrationServiceConfiguration config, DocumentCache documentCache, String callerId, String fieldName) throws se.idsec.signservice.integration.core.error.InputValidationException
      Performs a pre-processing of the supplied document where the document is validated, and in some cases updated with default settings.
      Parameters:
      document - the document to process
      signRequestInput - the sign request input
      config - the current policy configuration
      documentCache - the document cache
      callerId - optional ID for the calling entity
      fieldName - used for error reporting and logging
      Returns:
      a processed (and possibly updated) document
      Throws:
      se.idsec.signservice.integration.core.error.InputValidationException - for validation errors
    • process

      se.swedenconnect.schemas.csig.dssext_1_1.SignTaskData process(@Nonnull ProcessedTbsDocument document, @Nonnull String signatureAlgorithm, @Nonnull IntegrationServiceConfiguration config) throws DocumentProcessingException
      Prepares the document for signing by creating a SignTaskData element.
      Parameters:
      document - the document to sign
      signatureAlgorithm - the signature algorithm to be used for signing the document
      config - profile configuration
      Returns:
      a SignTaskData element
      Throws:
      DocumentProcessingException - for processing errors