Skip to content

open-eid/SiVa-demo-application

Repository files navigation

EU Regional Development Fund

Signature Verification Service Demo Application

SiVa CI with Maven GitHub license

SiVa demo is digital signature validation web interface that uses SiVa APIs to validate following file types:

  • Estonian DDOC containers
  • Estonian BDOC containers with TimeMark and TimeStamp signatures
  • Estonian ASiC-S containers with time stamp tokens
  • ETSI standard based ASiC-E and ASiC-S containers
  • ETSI standard based XAdES, CAdES and PAdES signatures
  • ETSI standard based XAdES signatures with datafiles in hashcode form

Requirements

These are minimum requirements to build and develop SiVa demo project:

  • git - to easily download and update code. You can download git here
  • Java JDK 17 - to compile and run SiVa demo
  • IDE - to develop SiVa. We recommend to use JetBrains IntelliJ
  • Optionally You can also install Maven but it is not needed because SiVa project uses Maven wrapper to install maven
  • SiVa parent project - Can be found here

How to build

Using Maven Wrapper

Recommended way of building this project is using Maven Wrapper. Run the following command:

./mvnw clean install

For Docker

Alternatively, run the following command to build Docker image:

./mvnw clean spring-boot:build-image

TODO:

On Windows machine there may be a situation where a test fails due to how XML files are parsed in. Workaround is to disable givenValidRequestWillReturnSOAPValidationReport() test using @Disabled tag.

How-to run

With docker

Follow the Docker instructions for SiVa webapp to run both apps at the same time.

Without docker

SiVa project by default compiles an executable JAR file that can be run after successfully building the project by issuing below command:

java -jar target/siva-demo-application-X.X.X.jar

Another option is to run it directly with:

./mvnw spring-boot:run

Accessing the application

After the demo application is built and running You can point Your browser to URL: http://localhost:9000.

  • SiVa Demo Application UI allows to upload 1 file at a time and with maximum file size 11 MiB.

Sample of validation result

WAR and Tomcat setup for legacy systems

NOTE: Each SiVa service must be deployed to separate instance of Tomcat to avoid Java JAR library version conflicts.

To build the WAR file use helper script with all the correct Maven parameters.

./war-build.sh

Copy built WAR file into Tomcat webapps directory and start the servlet container. NB! X.X.X denotes the version you are running.

cp target/siva-demo-application-X.X.X.war apache-tomcat-7.0.70/webapps
./apache-tomcat-7.0.77/bin/catalina.sh run

How-to set WAR deployed SiVa application.properties

SiVa override properties can be set using application.properties file. The file can locate anywhare in the host system. To make properties file accessible for SiVa you need to create or edit setenv.sh placed inside bin directory.

Contents of the setenv.sh file should look like:

export CATALINA_OPTS="-Dspring.config.location=file:/path/to/application.properties"

How-to run tests

Unit test are integral part of the SiVa code base. The tests are automatically executed every time the application is built. The build will fail if any of the tests fail.

To execute the tests from command line after application is built use:

./mvnw verify

Open source software used to build SiVa demo

Full list of open source Java libraries used to build SiVa can be found in our Open Source Software used page

Documentation

Read SiVa documentation

TODO:

On Windows machine there may be a situation where a test fails due mismatch of line separators (LF vs CRLF). Workaround is to disable a test in SivaSOAPValidationServiceClientTest class located in siva package.

@Test
@Disabled
void givenValidRequestWillReturnSOAPValidationReport(@TempDir File testingFolder)

About

No description, website, or topics provided.

Resources

License