Git Product home page Git Product logo

Comments (4)

bsanchezb avatar bsanchezb commented on September 26, 2024

Hello,

Yes, it is possible to create -T/-LT/-LTA signatures with REST API. For this you will need to provide the corresponding target signature level within the signature parameters, e.g. for PAdES-BASELINE-T level:

{
  "parameters" : {
      ...
      "signatureLevel" : "PAdES_BASELINE_T",
      ...
  },
  ...
}

You may create the extended signature as a a part of the normal signature creation process (i.e. using the #getDataToSign/#signDocument methods) or separately by extending the existing signature (see #extend method).

Please note that the corresponding settings for the TSP Source and CRL/OCSP sources has to be configured on the server side. For more information about the configuration please see the corresponding chapter of the documentation.

If you use dss-demonstrations webapp, you may provide a spring bean configuration of the TSP Source through the properties file (see tsp-source parameter) as in the example. But you may also do it within the code, as explained in the documentation above.
The CRL and OCSP sources are already configured in the demo to fetch the data from online resources.

I hope this will help you.

Best regards,
Aleksandr.

from dss-demonstrations.

nourbakhsh avatar nourbakhsh commented on September 26, 2024

Thanks for your quick reply, it has shown me the path to solve this issue. It would be really nice if there was an easier way to add a custom TSP Source and extend the app with a custom trusted CA eg. by adding them to the "dss.properties" file.

Here my journey if someone else run into this:
Change the tsp-config.xml file as below:
/dss-demo-bundle-5.11.1/apache-tomcat-8.5.82/webapps/ROOT/WEB-INF/classes/config/tsp-config.xml file: tsp-config.xml.txt

<beans xmlns="http://www.springframework.org/schema/beans"
	   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	   xmlns:context="http://www.springframework.org/schema/context"
	   xsi:schemaLocation="
		http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.3.xsd
		http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.3.xsd">

<bean id="tspSource" class="eu.europa.esig.dss.service.tsp.OnlineTSPSource">
	<property name="tspServer" value="https://freetsa.org/tsr " />
</bean>
</beans>

To send OCSP requests in an Test environment where the certificates are not in EUTL it is necessry to set certificateVerifier.setCheckRevocationForUntrustedChains(true) in "DSSBeanConfig.java" or extend it with your custom CA and recompile the code.

After this it is possible to set the signaturparameter to PAdES_BASELINE_LT as mentioned by @bsanchezb

  "parameters" : {
      ...
      "signatureLevel" : "PAdES_BASELINE_LT",
      ...
  },
  ...
}```

from dss-demonstrations.

bsanchezb avatar bsanchezb commented on September 26, 2024

Indeed, for non-EU certificate chains, the corresponding trust anchors should be added to the CertificateVerifier or the check for untrusted chains should be disabled as shown in your reply (but please note that it is not a recommended option to be used in production).
Thank you for the follow-up reply, I'm sure it will be helpful by the community.

Best regards,
Aleksandr.

from dss-demonstrations.

samsam002 avatar samsam002 commented on September 26, 2024

I was coming to the repo to ask the same question. So thank for sharing.
Indeed, would you please explicit in more details the steps to add the external CA to the demo web app. Thanks in avance

from dss-demonstrations.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.