integration-impl/src/main/java/se/idsec/signservice/integration/process/impl/DefaultSignResponseProcessor.java
protected <T, X extends AdesObject> SignedDocument processDocument(final SignedDocumentProcessor<T, X> processor,
      final SignTaskData signTaskData,
      final List<X509Certificate> signerCertificateChain,
      final SignatureSessionState state,
      final SignResponseWrapper signResponse,
      final SignResponseProcessingParameters parameters) throws SignServiceIntegrationException {

    // Find a corresponding TbsDocument ...
    final TbsDocument tbsDocument = this.getTbsDocument(signTaskData, state);

    // Build the signed document ...
    final CompiledSignedDocument<T, X> signedDocument = processor.buildSignedDocument(tbsDocument, signTaskData, signerCertificateChain,
      state.getSignRequest(), parameters);

    // Validate the signature of the document ...
    processor.validateSignedDocument(
      signedDocument.getDocument(), signerCertificateChain.get(0), signTaskData, parameters, state.getSignRequest().getRequestID());

    // Optionally, validate the XAdES object ...
    if (signedDocument.getAdesObject() != null) {
      processor.validateAdesObject(signedDocument.getAdesObject(), signerCertificateChain.get(0), signTaskData,
        state.getSignRequest(), signResponse, parameters);
    }

    return signedDocument.getSignedDocument();
  }
/**
   * Compiles a signed document and validates it.
   * 
   * @param processor
   *          the document processor
   * @param signTaskData
   *          the sign task data
   * @param signerCertificateChain
   *          the certificate chain
   * @param state
   *          the session state
   * @param signResponse
   *          the sign response
   * @param parameters
   *          optional processing parameters
   * @return a signed document
   * @throws SignServiceIntegrationException
   *           for processing errors
   */
Compiles a signed document and validates it.


Compiles a signed document and validates it .
protected <T, X extends AdesObject> SignedDocument processDocument(final SignedDocumentProcessor<T, X> processor,
      final SignTaskData signTaskData,
      final List<X509Certificate> signerCertificateChain,
      final SignatureSessionState state,
      final SignResponseWrapper signResponse,
      final SignResponseProcessingParameters parameters) throws SignServiceIntegrationException {
    final TbsDocument tbsDocument = this.getTbsDocument(signTaskData, state);
    final CompiledSignedDocument<T, X> signedDocument = processor.buildSignedDocument(tbsDocument, signTaskData, signerCertificateChain,
      state.getSignRequest(), parameters);
    processor.validateSignedDocument(
      signedDocument.getDocument(), signerCertificateChain.get(0), signTaskData, parameters, state.getSignRequest().getRequestID());
    if (signedDocument.getAdesObject() != null) {
      processor.validateAdesObject(signedDocument.getAdesObject(), signerCertificateChain.get(0), signTaskData,
        state.getSignRequest(), signResponse, parameters);
    }
    return signedDocument.getSignedDocument();
  }
protected < T , X extends AdesObject > SignedDocument processDocument ( final SignedDocumentProcessor < T , X > processor , final SignTaskData signTaskData , final List < X509Certificate > signerCertificateChain , final SignatureSessionState state , final SignResponseWrapper signResponse , final SignResponseProcessingParameters parameters ) throws SignServiceIntegrationException { final TbsDocument tbsDocument = this . getTbsDocument ( signTaskData , state ) ; final CompiledSignedDocument < T , X > signedDocument = processor . buildSignedDocument ( tbsDocument , signTaskData , signerCertificateChain , state . getSignRequest ( ) , parameters ) ; processor . validateSignedDocument ( signedDocument . getDocument ( ) , signerCertificateChain . get ( 0 ) , signTaskData , parameters , state . getSignRequest ( ) . getRequestID ( ) ) ; if ( signedDocument . getAdesObject ( ) != null ) { processor . validateAdesObject ( signedDocument . getAdesObject ( ) , signerCertificateChain . get ( 0 ) , signTaskData , state . getSignRequest ( ) , signResponse , parameters ) ; } return signedDocument . getSignedDocument ( ) ; }
Compiles a signed document and validates it.
Compiles a signed document and validates it .
// Find a corresponding TbsDocument ... // Build the signed document ... // Validate the signature of the document ... // Optionally, validate the XAdES object ...