diff --git a/.gitignore b/.gitignore
index 3666fd005..cc8275e7c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,11 +1,14 @@
-build
-target
-javadoc
+/build
+/target
.idea/workspace.xml
.idea/uiDesigner.xml
.idea/dictionaries/xp.xml
.idea/libraries
*.log
-utility-package-lib
-zip-package-lib
+/utility-package-lib
+/zip-package-lib
/buildNumber.properties
+/Old*
+/logback.xml
+!/src/main/etc/logback.xml
+/lib
diff --git a/.idea/codeStyleSettings.xml b/.idea/codeStyleSettings.xml
index 4e722d6c9..4959716fc 100644
--- a/.idea/codeStyleSettings.xml
+++ b/.idea/codeStyleSettings.xml
@@ -37,16 +37,12 @@
-
-
-
-
diff --git a/README.md b/README.md
index ad8fc79bc..06a1fea5b 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,4 @@
-![EU Regional Development Fund](doc/resources/EL_Regionaalarengu_Fond_horisontaalne-vaike.jpg)
+![EU Regional Development Fund](src/main/doc/resources/EL_Regionaalarengu_Fond_horisontaalne-vaike.jpg)
# DigiDoc4j
diff --git a/RELEASE-NOTES.txt b/RELEASE-NOTES.txt
index 2ee81e710..9208b07db 100644
--- a/RELEASE-NOTES.txt
+++ b/RELEASE-NOTES.txt
@@ -1,4 +1,27 @@
DigiDoc4J Java library release notes
+------------------------------------
+Release 1.0.8.beta.1
+------------------
+Summary of the major changes since 1.0.7.2
+------------------------------------------
+* Started to use DSS version 5.1 (sd-dss.5.1.d4j.5).
+* Added support for removing signature from container.
+* Added support for creating, timestamping and validating the ASiCS containers.
+* Added support for validating PADES containers (PDF-files with signature).
+* Major refactoring of code
+ - classes from package org.digidoc4j.impl.bdoc are now in org.digidoc4j.impl.asic.asice.bdoc;
+ - the common functionality for ASiCE, ASiCS and BDOC are in package org.digidoc4j.impl.asic;
+ - the common functionality for ASiCE and BDOC are in package org.digidoc4j.impl.asic.asice;
+ - method DataToSign.getDigestToSign() is renamed to DataToSign.getDataToSign().
+* Added new API methods for accessing signature validation details.
+* Added support for BDOC validation warning when SHA-1 is used.
+* Documentation (github wiki, javadoc in github) is updated.
+
+Known issues
+------------
+* Signing with ID-card and using PKCS11SignatureToken class have still a problem
+when encryption algorithm is ECDSA. We are working on it.
+
------------------------------------
Release 1.0.7.2
------------------
diff --git a/assembly/zip.xml b/assembly/zip.xml
deleted file mode 100644
index 8bcb59fba..000000000
--- a/assembly/zip.xml
+++ /dev/null
@@ -1,15 +0,0 @@
-
- library
- /
-
- zip
-
-
-
- zip-package-lib
- .
-
-
-
\ No newline at end of file
diff --git a/digidoc4j.iml b/digidoc4j.iml
index e79bdb966..4e9d49bfc 100644
--- a/digidoc4j.iml
+++ b/digidoc4j.iml
@@ -1,19 +1,16 @@
-
+
-
-
-
-
-
+
+
+
+
-
-
@@ -27,7 +24,7 @@
-
+
@@ -57,31 +54,34 @@
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pom.xml b/pom.xml
index 7bdeed334..ac6a9c4a2 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1,1096 +1,1063 @@
-
- 4.0.0
- org.digidoc4j
- digidoc4j
- jar
- 1.0.7.2
- DigiDoc4j
- DigiDoc4j is a Java library for digitally signing documents and creating digital signature containers of signed documents
- https://github.com/open-eid/digidoc4j
-
-
- GNU Lesser General Public License, Version 2.1
- http://www.gnu.org/licenses/lgpl-2.1.html
-
-
-
- scm:git:git@github.com:open-eid/digidoc4j.git
- scm:git:git@github.com:open-eid/digidoc4j.git
- https://github.com/open-eid/digidoc4j.git
-
-
- Pivotal
- https://www.pivotaltracker.com/n/projects/1110130
-
-
-
- Rainer Villido
- Rainer.Villido at Nortal.com
- Nortal
- http://www.nortal.com
-
-
- Mihkel Selgal
- Mihkel.Selgal at Nortal.com
- Nortal
- http://www.nortal.com
-
-
- Risto Alas
- Risto.Alas at Nortal.com
- Nortal
- http://www.nortal.com
-
-
- Aho Augasmägi
- aho at codeborne.com
- Codeborne
- http://www.codeborne.com
-
-
- Allan Juhanson
- Allan.Juhanson at Nortal.com
- Nortal
- http://www.nortal.com
-
-
- Martin Beldman
- martin at codeborne.com
- Codeborne
- http://www.codeborne.com
-
-
- Andrei Smirnov
- andrei.smirnov at cgi.com
- CGI Eesti
- https://www.cgi.ee
-
-
- Indrek Jentson
- indrek.jentson at cgi.com
- CGI Eesti
- https://www.cgi.ee
-
-
- Margus Kamlat
- margus.kamlat at cgi.com
- CGI Eesti
- https://www.cgi.ee
-
-
- Priit Serk
- priit.serk at cgi.com
- CGI Eesti
- https://www.cgi.ee
-
-
+ 4.0.0
+ org.digidoc4j
+ digidoc4j
+ jar
+ 1.0.8.beta.1
+ DigiDoc4j
+ DigiDoc4j is a Java library for digitally signing documents and creating digital signature containers
+ of signed documents
+
+ https://github.com/open-eid/digidoc4j
+
+
+ GNU Lesser General Public License, Version 2.1
+ http://www.gnu.org/licenses/lgpl-2.1.html
+
+
+
+ scm:git:git@github.com:open-eid/digidoc4j.git
+ scm:git:git@github.com:open-eid/digidoc4j.git
+ https://github.com/open-eid/digidoc4j.git
+
+
+
+ ossrh
+ https://oss.sonatype.org/content/repositories/snapshots/
+
+
+ ossrh
+ https://oss.sonatype.org/service/local/staging/deploy/maven2/
+
+
+
+ Pivotal
+ https://www.pivotaltracker.com/n/projects/1110130
+
+
+
+ Rainer Villido
+ Rainer.Villido at Nortal.com
+ Nortal
+ http://www.nortal.com
+
+
+ Mihkel Selgal
+ Mihkel.Selgal at Nortal.com
+ Nortal
+ http://www.nortal.com
+
+
+ Risto Alas
+ Risto.Alas at Nortal.com
+ Nortal
+ http://www.nortal.com
+
+
+ Aho Augasmägi
+ aho at codeborne.com
+ Codeborne
+ http://www.codeborne.com
+
+
+ Allan Juhanson
+ Allan.Juhanson at Nortal.com
+ Nortal
+ http://www.nortal.com
+
+
+ Martin Beldman
+ martin at codeborne.com
+ Codeborne
+ http://www.codeborne.com
+
+
+ Andrei Smirnov
+ andrei.smirnov at cgi.com
+ CGI Eesti
+ https://www.cgi.ee
+
+
+ Indrek Jentson
+ indrek.jentson at cgi.com
+ CGI Eesti
+ https://www.cgi.ee
+
+
+ Margus Kamlat
+ margus.kamlat at cgi.com
+ CGI Eesti
+ https://www.cgi.ee
+
+
+ Priit Serk
+ priit.serk at cgi.com
+ CGI Eesti
+ https://www.cgi.ee
+
+
+ Janar Rahumeel
+ janar.rahumeel at cgi.com
+ CGI Eesti
+ https://www.cgi.ee
+
+
-
- 1.7
- 1.7
- 1.7
- UTF-8
- 1.7.25
- 1.2.3
- 1.54
- 4.11
- org.digidoc4j.dss
- 5.0.d4j.5
- ${project.basedir}/build/
- ${project.basedir}/utility-package-lib
- ${project.basedir}/zip-package-lib
- -Dfile.encoding=UTF-8
-
+
+ 1.7
+ 1.7
+ 1.7
+ UTF-8
+ 1.7.25
+ 1.2.3
+ 1.54
+ 4.11
+ org.digidoc4j.dss
+ 5.1.d4j.5
+ ${project.build.directory}/build/util
+ ${project.build.directory}/library/util
+ ${project.build.directory}/library/zip
+ -Dfile.encoding=UTF-8
+
-
-
- notJava8
-
- [1.7,1.8)
-
- ${java.home}/lib/jfxrt.jar
-
-
-
- 1.7
- ${java.home}/lib/jfxrt.jar
-
-
+
+
+ notJava8
+
+ [1.7,1.8)
+
+ ${java.home}/lib/jfxrt.jar
+
+
+
+ 1.7
+ ${java.home}/lib/jfxrt.jar
+
+
+
+ java8
+
+ [1.8,)
+
+ ${java.home}/lib/ext/jfxrt.jar
+
+
+
+ 1.7
+ ${java.home}/lib/ext/jfxrt.jar
+ -Xdoclint:none
+
+
+
+ delivery
+
+
+
+ maven-surefire-plugin
+
+ true
+
+
+
+ maven-compiler-plugin
+
+
+ default-testCompile
+ test-compile
+
+ testCompile
+
+
+ true
+
+
+
+
+
+
+
+
+ test-coverage
+
+
+
+ maven-surefire-plugin
+
+ true
+
+
+
+ org.jacoco
+ jacoco-maven-plugin
+ 0.7.9
+
+ ${project.build.directory}/jacoco-unit.exec
+ ${project.build.directory}/jacoco-unit.exec
+
+
+
+ prepare-unit-test-agent
+ process-test-classes
+
+ prepare-agent
+
+
+
+ generate-unit-test-report
+ package
+
+ merge
+ report
+
+
+
+
+
+
+
+
-
- java8
-
- [1.8,)
-
- ${java.home}/lib/ext/jfxrt.jar
-
-
-
- 1.7
- ${java.home}/lib/ext/jfxrt.jar
- -Xdoclint:none
-
-
+
+
+ lib
+ file:${project.basedir}/src/main/lib
+
+
-
- delivery
-
+
+
+ ee.sk.digidoc
+ jdigidoc
+ 3.12.1
+ compile
+
+
+ iaik.pkcs
+ iaikPkcs11Wrapper
+
+
+
+
+ commons-cli
+ commons-cli
+ 1.4
+ compile
+
+
+ org.apache.commons
+ commons-compress
+ 1.3
+ compile
+
+
+ commons-io
+ commons-io
+ 2.5
+ compile
+
+
+ commons-codec
+ commons-codec
+ 1.10
+ compile
+
+
+ org.apache.commons
+ commons-lang3
+ 3.6
+ compile
+
+
+ commons-logging
+ commons-logging
+ 1.2
+ compile
+
+
+ org.apache.commons
+ commons-collections4
+ 4.1
+ compile
+
+
+ org.apache.httpcomponents
+ httpclient
+ 4.5.3
+ compile
+
+
+ org.apache.httpcomponents
+ httpcore
+ 4.4.6
+ compile
+
+
+ org.apache.santuario
+ xmlsec
+ 2.0.9
+ compile
+
+
+ org.codehaus.woodstox
+ woodstox-core-asl
+
+
+
+
+ org.bouncycastle
+ bcmail-jdk15on
+ ${bouncycastle.version}
+ compile
+
+
+ org.bouncycastle
+ bcpkix-jdk15on
+ ${bouncycastle.version}
+ compile
+
+
+ org.bouncycastle
+ bcprov-jdk15on
+ ${bouncycastle.version}
+ compile
+
+
+ xalan
+ serializer
+ 2.7.2
+ compile
+
+
+ xml-apis
+ xml-apis
+
+
+
+
+ xalan
+ xalan
+ 2.7.2
+ compile
+
+
+ org.yaml
+ snakeyaml
+ 1.18
+ compile
+
+
+ org.slf4j
+ slf4j-api
+ ${slf4j.version}
+ compile
+
+
+
+ ch.qos.logback
+ logback-classic
+ ${logback-classic.version}
+ compile
+
+
+ ch.qos.logback
+ logback-core
+ ${logback-classic.version}
+ compile
+
+
+ org.slf4j
+ log4j-over-slf4j
+ ${slf4j.version}
+ compile
+
+
+ org.hamcrest
+ hamcrest-core
+ 1.3
+ test
+
+
+ org.mockito
+ mockito-all
+ 1.10.19
+ test
+
+
+ com.github.stefanbirkner
+ system-rules
+ 1.16.1
+ test
+
+
+ junit
+ junit
+ ${junit.version}
+ test
+
+
+ xmlunit
+ xmlunit
+ 1.6
+ test
+
+
+ org.hamcrest
+ hamcrest-library
+ 1.3
+ test
+
+
+ org.databene
+ contiperf
+ 2.3.4
+ test
+
+
+ com.github.tomakehurst
+ wiremock
+ 1.58
+ test
+
+
+ org.mortbay.jetty
+ jetty
+ 6.1.26
+ test
+
+
+ org.mortbay.jetty
+ jetty-util
+ 6.1.26
+ test
+
+
+ org.mortbay.jetty
+ servlet-api
+ 2.5.20110712
+ test
+
+
+ com.google.guava
+ guava
+ 20.0
+ compile
+
+
+ com.fasterxml.jackson.core
+ jackson-databind
+ 2.8.8
+ test
+
+
+ com.fasterxml.jackson.core
+ jackson-core
+ 2.8.8
+ test
+
+
+ com.fasterxml.jackson.core
+ jackson-annotations
+ 2.8.8
+ test
+
+
+
+ org.apache.pdfbox
+ pdfbox
+ 2.0.8
+ compile
+
+
+ org.apache.pdfbox
+ fontbox
+ 2.0.8
+ compile
+
+
+
+ org.skyscreamer
+ jsonassert
+ 1.5.0
+ test
+
+
+ com.vaadin.external.google
+ android-json
+
+
+
+
+ org.json
+ json
+ 20160810
+ test
+
+
+ com.jayway.jsonpath
+ json-path
+
+
+ net.minidev
+ json-smart
+
+
+
+
+ log4j
+ log4j
+ 1.2.17
+ compile
+
+
+ ${dss.groupId}
+ dss-common-validation-jaxb
+ ${dss.version}
+ compile
+
+
+ ${dss.groupId}
+ dss-detailed-report-jaxb
+ ${dss.version}
+ compile
+
+
+ ${dss.groupId}
+ dss-diagnostic-jaxb
+ ${dss.version}
+ compile
+
+
+ ${dss.groupId}
+ dss-document
+ ${dss.version}
+ compile
+
+
+ ${dss.groupId}
+ dss-model
+ ${dss.version}
+ compile
+
+
+ ${dss.groupId}
+ dss-policy-jaxb
+ ${dss.version}
+ compile
+
+
+ ${dss.groupId}
+ dss-reports
+ ${dss.version}
+ compile
+
+
+ ${dss.groupId}
+ dss-service
+ ${dss.version}
+ compile
+
+
+ ${dss.groupId}
+ dss-simple-report-jaxb
+ ${dss.version}
+ compile
+
+
+ ${dss.groupId}
+ dss-spi
+ ${dss.version}
+ compile
+
+
+ ${dss.groupId}
+ dss-token
+ ${dss.version}
+ compile
+
+
+ ${dss.groupId}
+ dss-tsl-jaxb
+ ${dss.version}
+ compile
+
+
+ ${dss.groupId}
+ dss-tsl-validation
+ ${dss.version}
+ compile
+
+
+ ${dss.groupId}
+ dss-xades
+ ${dss.version}
+ compile
+
+
+ ${dss.groupId}
+ dss-cades
+ ${dss.version}
+ compile
+
+
+ ${dss.groupId}
+ validation-policy
+ ${dss.version}
+ compile
+
+
+ ${dss.groupId}
+ dss-asic-common
+ ${dss.version}
+ compile
+
+
+ ${dss.groupId}
+ dss-asic-cades
+ ${dss.version}
+ compile
+
+
+ ${dss.groupId}
+ dss-asic-xades
+ ${dss.version}
+ compile
+
+
+ ${dss.groupId}
+ dss-pades
+ ${dss.version}
+ compile
+
+
+ ${dss.groupId}
+ dss-utils
+ ${dss.version}
+ compile
+
+
+ ${dss.groupId}
+ dss-utils-apache-commons
+ ${dss.version}
+ compile
+
+
+ ${dss.groupId}
+ dss-utils-google-guava
+ ${dss.version}
+ compile
+
+
+
+
-
- maven-surefire-plugin
-
- true
-
-
-
- maven-compiler-plugin
-
-
- default-testCompile
- test-compile
-
- testCompile
-
+
+ org.codehaus.mojo
+ buildnumber-maven-plugin
+ 1.4
+
+
+ buildnumber
+ validate
+
+ create
+
+
+
+
+ {0,number}
+
+ - buildNumber
+
+ false
+ false
+ unknownbuild
+
+
+
+ org.apache.maven.plugins
+ maven-dependency-plugin
+
+
+ copy-dependencies
+ compile
+
+ copy-dependencies
+
+
+ true
+ true
+
+
+
+ copy-utils-jars
+ compile
+
+ copy-dependencies
+
+
+ compile
+ ${dss.util.lib}
+ true
+ true
+
+ contiperf, log4j
+
+
+
+
+ copy-zip-jars
+ compile
+
+ copy-dependencies
+
+
+ compile
+ ${dss.zip.lib}
+ true
+ true
+
+ contiperf, log4j-over-slf4j
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-assembly-plugin
+ 3.0.0
+
+
+ src/assembly/zip.xml
+
+
+
+
+ zip-archive
+ package
+
+ single
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-jar-plugin
+ 3.0.2
+
+
+ custom-deploy
+ package
+
+ jar
+
+
+ library
+
+ prototype/**
+
+
+
+
+ DigiDoc4j
+
+ Republic of Estonia Information System Authority
+
+ Java BDoc/DigiDoc library
+ ${project.version}
+
+
+
+
+
+
+
+
+
+ org.jacoco
+ jacoco-maven-plugin
+ 0.7.9
- true
+ ${project.build.directory}/jacoco-unit.exec
+ ${project.build.directory}/jacoco-unit.exec
-
-
-
+
+
+ prepare-unit-test-agent
+
+ prepare-agent
+
+
+
+ generate-unit-test-report
+
+ merge
+ report
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-surefire-plugin
+ 2.20.1
+
+
+ ${project.basedir}/src/main/lib/esteidtestcerts.jar
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-antrun-plugin
+ 1.8
+
+
+ ant-util-zip
+ package
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ run
+
+
+
+ ant-bundle-jar
+ install
+
+
+
+
+
+
+
+
+
+
+ run
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-source-plugin
+ 3.0.1
+
+
+ attach-sources
+ package
+
+ jar
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-javadoc-plugin
+
+
+ org.apache.maven.plugins
+ maven-install-plugin
+ 2.5.2
+
+
+ org.apache.maven.plugins
+ maven-gpg-plugin
+ 1.6
+
+
+ sign-artifacts
+ verify
+
+ sign
+
+
+
+
-
-
-
- test-coverage
-
+
+
+
+ org.jacoco
+ jacoco-maven-plugin
+ 0.7.9
+
+
+ org.apache.maven.plugins
+ maven-install-plugin
+ 2.5.2
+
+
+ org.apache.maven.plugins
+ maven-compiler-plugin
+ 3.6.1
+
+ ${project.encoding}
+ ${maven.compiler.source}
+ ${maven.compiler.target}
+
+
+
+ org.apache.maven.plugins
+ maven-source-plugin
+ 3.0.1
+
+
+ org.apache.maven.plugins
+ maven-surefire-plugin
+ 2.20
+
+
+ org.apache.maven.plugins
+ maven-resources-plugin
+ 3.0.2
+
+ ${project.encoding}
+
+ jks
+ p12
+
+
+
+
+ org.apache.maven.plugins
+ maven-jar-plugin
+ 3.0.2
+
+
+ org.apache.maven.plugins
+ maven-shade-plugin
+ 3.0.0
+
+
+ org.apache.maven.plugins
+ maven-assembly-plugin
+ 3.0.0
+
+
+ org.apache.maven.plugins
+ maven-release-plugin
+ 2.5.3
+
+ true
+ ${project.version}
+
+
+
+ org.apache.maven.plugins
+ maven-javadoc-plugin
+ 3.0.0
+
+ prototype,org.digidoc4j.impl,org.digidoc4j.main,org.digidoc4j.utils
+ ${project.basedir}/src/main/doc
+ true
+ ${project.basedir}/src/main/doc/overview.html
+ public
+
+
+
+ attach-javadocs
+
+ jar
+
+
+
+
+
+ org.jvnet.jaxb2.maven2
+ maven-jaxb2-plugin
+ 0.13.2
+
+
+ org.apache.maven.plugins
+ maven-deploy-plugin
+ 2.8.2
+
+
+ org.apache.maven.plugins
+ maven-antrun-plugin
+ 1.8
+
+
+ org.apache.maven.plugins
+ maven-gpg-plugin
+ 1.6
+
+
+ org.sonatype.plugins
+ nexus-staging-maven-plugin
+ 1.6.8
+ true
+
+ ossrh
+ https://oss.sonatype.org/
+ true
+
+
+
+
+
+
+
-
- maven-surefire-plugin
-
- true
-
-
-
- org.jacoco
- jacoco-maven-plugin
- 0.7.9
-
- ${project.basedir}/target/jacoco-unit.exec
- ${project.basedir}/target/jacoco-unit.exec
-
-
-
- prepare-unit-test-agent
- process-test-classes
-
- prepare-agent
-
-
-
- generate-unit-test-report
- package
-
- merge
- report
-
-
-
-
+
+ org.apache.maven.plugins
+ maven-javadoc-plugin
+ 3.0.0
+
+ prototype,org.digidoc4j.impl,org.digidoc4j.main,org.digidoc4j.utils
+ ${project.basedir}/src/main/doc
+ true
+ ${project.basedir}/src/main/doc/overview.html
+ public
+
+
-
-
-
-
-
-
- lib
- file:${project.basedir}/lib
-
-
-
-
-
- ee.sk.digidoc
- jdigidoc
- 3.12.1
- compile
-
-
- iaik.pkcs
- iaikPkcs11Wrapper
-
-
-
-
- commons-cli
- commons-cli
- 1.4
- compile
-
-
- org.apache.commons
- commons-compress
- 1.3
- compile
-
-
- commons-io
- commons-io
- 2.5
- compile
-
-
- commons-codec
- commons-codec
- 1.10
- compile
-
-
- org.apache.commons
- commons-lang3
- 3.6
- compile
-
-
- commons-logging
- commons-logging
- 1.2
- compile
-
-
- org.apache.commons
- commons-collections4
- 4.1
- compile
-
-
- org.apache.httpcomponents
- httpclient
- 4.5.3
- compile
-
-
- org.apache.httpcomponents
- httpcore
- 4.4.6
- compile
-
-
- org.apache.santuario
- xmlsec
- 2.0.8
- compile
-
-
- org.codehaus.woodstox
- woodstox-core-asl
-
-
-
-
- org.bouncycastle
- bcmail-jdk15on
- ${bouncycastle.version}
- compile
-
-
- org.bouncycastle
- bcpkix-jdk15on
- ${bouncycastle.version}
- compile
-
-
- org.bouncycastle
- bcprov-jdk15on
- ${bouncycastle.version}
- compile
-
-
- xalan
- serializer
- 2.7.2
- compile
-
-
- xml-apis
- xml-apis
-
-
-
-
- xalan
- xalan
- 2.7.2
- compile
-
-
- org.yaml
- snakeyaml
- 1.18
- compile
-
-
- org.slf4j
- slf4j-api
- ${slf4j.version}
- compile
-
-
-
- ch.qos.logback
- logback-classic
- ${logback-classic.version}
- compile
-
-
- ch.qos.logback
- logback-core
- ${logback-classic.version}
- compile
-
-
- org.slf4j
- log4j-over-slf4j
- ${slf4j.version}
- compile
-
-
-
- org.hamcrest
- hamcrest-core
- 1.3
- test
-
-
- org.mockito
- mockito-all
- 1.10.19
- test
-
-
- com.github.stefanbirkner
- system-rules
- 1.16.1
- test
-
-
- junit
- junit
- ${junit.version}
- test
-
-
- xmlunit
- xmlunit
- 1.6
- test
-
-
- org.hamcrest
- hamcrest-library
- 1.3
- test
-
-
- org.databene
- contiperf
- 2.3.4
- test
-
-
-
- com.github.tomakehurst
- wiremock
- 1.58
- test
-
-
- org.mortbay.jetty
- jetty
- 6.1.26
- test
-
-
- org.mortbay.jetty
- jetty-util
- 6.1.26
- test
-
-
- org.mortbay.jetty
- servlet-api
- 2.5.20110712
- test
-
-
- com.google.guava
- guava
- 20.0
- compile
-
-
- com.fasterxml.jackson.core
- jackson-databind
- 2.8.8
- test
-
-
- com.fasterxml.jackson.core
- jackson-core
- 2.8.8
- test
-
-
- com.fasterxml.jackson.core
- jackson-annotations
- 2.8.8
- test
-
-
- org.skyscreamer
- jsonassert
- 1.5.0
- test
-
-
- com.vaadin.external.google
- android-json
-
-
-
-
- org.json
- json
- 20160810
- test
-
-
- com.jayway.jsonpath
- json-path
-
-
- net.minidev
- json-smart
-
-
-
-
- log4j
- log4j
- 1.2.17
- compile
-
-
-
- ${dss.groupId}
- dss-common-validation-jaxb
- ${dss.version}
- compile
-
-
- ${dss.groupId}
- dss-detailed-report-jaxb
- ${dss.version}
- compile
-
-
- ${dss.groupId}
- dss-diagnostic-jaxb
- ${dss.version}
- compile
-
-
- ${dss.groupId}
- dss-document
- ${dss.version}
- compile
-
-
- ${dss.groupId}
- dss-model
- ${dss.version}
- compile
-
-
- ${dss.groupId}
- dss-policy-jaxb
- ${dss.version}
- compile
-
-
- ${dss.groupId}
- dss-reports
- ${dss.version}
- compile
-
-
- ${dss.groupId}
- dss-service
- ${dss.version}
- compile
-
-
- ${dss.groupId}
- dss-simple-report-jaxb
- ${dss.version}
- compile
-
-
- ${dss.groupId}
- dss-spi
- ${dss.version}
- compile
-
-
- ${dss.groupId}
- dss-token
- ${dss.version}
- compile
-
-
- ${dss.groupId}
- dss-tsl-jaxb
- ${dss.version}
- compile
-
-
- ${dss.groupId}
- dss-tsl-validation
- ${dss.version}
- compile
-
-
- ${dss.groupId}
- dss-xades
- ${dss.version}
- compile
-
-
- ${dss.groupId}
- dss-cades
- ${dss.version}
- compile
-
-
- ${dss.groupId}
- validation-policy
- ${dss.version}
- compile
-
-
- ${dss.groupId}
- dss-asic-common
- ${dss.version}
- compile
-
-
- ${dss.groupId}
- dss-asic-cades
- ${dss.version}
- compile
-
-
- ${dss.groupId}
- dss-asic-xades
- ${dss.version}
- compile
-
-
- ${dss.groupId}
- dss-utils
- ${dss.version}
- compile
-
-
- ${dss.groupId}
- dss-utils-apache-commons
- ${dss.version}
- compile
-
-
- ${dss.groupId}
- dss-utils-google-guava
- ${dss.version}
- compile
-
-
-
-
- src
- test
- build
- target/test-classes
-
-
-
- resources
-
- logback.xml
-
-
-
- conf
- conf
-
-
- keystore
-
- keystore_certs/*.*
- test_keystore_certs/*.*
-
- keystore
-
-
-
-
-
- maven-clean-plugin
- 3.0.0
-
-
- clean
- clean
-
- clean
-
-
-
-
- ${project.basedir}/lib
-
- **/esteidtestcerts.jar
- **/jacocoagent.jar
- **/jacocoant.jar
-
-
-
- ${dss.util.lib}
-
-
- ${dss.zip.lib}
-
-
- ${project.basedir}/build
-
-
- ${project.basedir}/target
-
-
-
-
-
-
-
- org.codehaus.mojo
- buildnumber-maven-plugin
- 1.4
-
-
- buildnumber
- validate
-
- create
-
-
-
-
- {0,number}
-
- - buildNumber
-
- false
- false
- unknownbuild
-
-
-
- org.apache.maven.plugins
- maven-dependency-plugin
-
-
- copy-dependencies
- compile
-
- copy-dependencies
-
-
- ${project.basedir}/lib
- true
- true
-
-
-
- copy-utils-jars
- compile
-
- copy-dependencies
-
-
- compile
- ${dss.util.lib}
- true
- true
-
- contiperf, dss-common-validation-jaxb,
- dss-detailed-report-jaxb, dss-diagnostic-jaxb, dss-document, dss-model, dss-policy-jaxb,
- dss-reports, dss-service, dss-simple-report-jaxb, dss-spi, dss-token, dss-tsl-jaxb,
- dss-tsl-validation, dss-xades, dss-cades, validation-policy, log4j
-
-
-
-
- copy-zip-jars
- compile
-
- copy-dependencies
-
-
- compile
- ${dss.zip.lib}
- true
- true
-
- contiperf, log4j-over-slf4j
-
-
-
-
-
-
-
- org.apache.maven.plugins
- maven-assembly-plugin
- 3.0.0
-
-
- assembly/zip.xml
-
-
-
-
- zip-archive
- package
-
- single
-
-
-
-
-
-
- org.apache.maven.plugins
- maven-jar-plugin
- 3.0.2
-
-
- main
- package
-
- jar
-
-
- library
-
- prototype/**
-
-
-
-
- DigiDoc4j
-
- Republic of Estonia Information System Authority
- Java BDoc/DigiDoc library
- ${project.version}
-
-
-
-
-
-
-
-
-
-
- org.jacoco
- jacoco-maven-plugin
- 0.7.9
-
- ${project.basedir}/target/jacoco-unit.exec
- ${project.basedir}/target/jacoco-unit.exec
-
-
-
- prepare-unit-test-agent
-
- prepare-agent
-
-
-
- generate-unit-test-report
-
- merge
- report
-
-
-
-
-
-
- org.apache.maven.plugins
- maven-surefire-plugin
- 2.20
-
-
- ${project.basedir}/lib/esteidtestcerts.jar
-
-
-
-
-
-
- org.apache.maven.plugins
- maven-antrun-plugin
- 1.8
-
-
- ant-util-zip
- package
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- run
-
-
-
- ant-bundle-jar
- install
-
-
-
-
-
-
-
-
-
-
- run
-
-
-
-
-
-
- org.apache.maven.plugins
- maven-source-plugin
- 3.0.1
-
-
- attach-sources
- package
-
- jar
-
-
-
-
-
- org.apache.maven.plugins
- maven-javadoc-plugin
-
-
-
- maven-deploy-plugin
-
-
- deploy
- deploy
-
- deploy
-
-
-
-
-
- org.apache.maven.plugins
- maven-install-plugin
- 2.5.2
-
-
- org.apache.maven.plugins
- maven-gpg-plugin
- 1.6
-
-
- sign-artifacts
- verify
-
- sign
-
-
-
-
-
+
-
-
-
- org.jacoco
- jacoco-maven-plugin
- 0.7.9
-
-
- org.apache.maven.plugins
- maven-install-plugin
- 2.5.2
-
-
- org.apache.maven.plugins
- maven-compiler-plugin
- 3.6.1
-
- ${project.encoding}
- ${maven.compiler.source}
- ${maven.compiler.target}
-
-
-
- org.apache.maven.plugins
- maven-source-plugin
- 3.0.1
-
-
- org.apache.maven.plugins
- maven-surefire-plugin
- 2.20
-
-
- org.apache.maven.plugins
- maven-resources-plugin
- 3.0.2
-
- ${project.encoding}
-
- jks
- p12
-
-
-
-
- org.apache.maven.plugins
- maven-jar-plugin
- 3.0.2
-
-
- org.apache.maven.plugins
- maven-shade-plugin
- 3.0.0
-
-
- org.apache.maven.plugins
- maven-assembly-plugin
- 3.0.0
-
-
- org.apache.maven.plugins
- maven-release-plugin
- 2.5.3
-
- true
- ${project.version}
-
-
-
- org.apache.maven.plugins
- maven-javadoc-plugin
- 2.10.4
-
- prototype
- ${project.basedir}/doc
- true
- ${project.basedir}/doc/overview.html
-
-
-
- attach-javadocs
-
- jar
-
-
-
-
-
- org.jvnet.jaxb2.maven2
- maven-jaxb2-plugin
- 0.13.2
-
-
- org.apache.maven.plugins
- maven-deploy-plugin
- 2.8.2
-
-
- org.apache.maven.plugins
- maven-antrun-plugin
- 1.8
-
-
- org.apache.maven.plugins
- maven-gpg-plugin
- 1.6
-
-
-
-
-
-
-
- org.apache.maven.plugins
- maven-javadoc-plugin
- 2.10.4
-
- prototype
- ${project.basedir}/doc
- true
- ${project.basedir}/doc/overview.html
-
-
-
-
diff --git a/publish.sh b/publish.sh
deleted file mode 100755
index da8a0a582..000000000
--- a/publish.sh
+++ /dev/null
@@ -1,22 +0,0 @@
-#!/bin/bash
-
-version="1.0.4"
-staging_url="https://oss.sonatype.org/service/local/staging/deploy/maven2/"
-#staging_url=file:/Users/rainer/tmp/test-local-repo
-repositoryId="ossrh"
-module="digidoc4j"
-
-# Starting GPG agent to store GPG passphrase so we wouldn't have to enter the passphrase every time
-eval $(gpg-agent --daemon --no-grab)
-export GPG_TTY=$(tty)
-export GPG_AGENT_INFO
-
-artifact="dist/$module-$version"
-echo "Deploying $artifact"
-mvn gpg:sign-and-deploy-file -DpomFile=$artifact.pom -Dfile=$artifact.jar -Durl=$staging_url -DrepositoryId=$repositoryId
-mvn gpg:sign-and-deploy-file -DpomFile=$artifact.pom -Dfile=$artifact-sources.jar -Dclassifier=sources -Durl=$staging_url -DrepositoryId=$repositoryId
-mvn gpg:sign-and-deploy-file -DpomFile=$artifact.pom -Dfile=$artifact-javadoc.jar -Dclassifier=javadoc -Durl=$staging_url -DrepositoryId=$repositoryId
-
-echo "Finished deployment"
-
-killall gpg-agent
\ No newline at end of file
diff --git a/src/assembly/zip.xml b/src/assembly/zip.xml
new file mode 100644
index 000000000..68de9e2e1
--- /dev/null
+++ b/src/assembly/zip.xml
@@ -0,0 +1,15 @@
+
+ library
+ /
+
+ zip
+
+
+
+ ${dss.zip.lib}
+ .
+
+
+
\ No newline at end of file
diff --git a/doc/EL_Regionaalarengu_Fond_horisontaalne.jpg b/src/main/doc/EL_Regionaalarengu_Fond_horisontaalne.jpg
similarity index 100%
rename from doc/EL_Regionaalarengu_Fond_horisontaalne.jpg
rename to src/main/doc/EL_Regionaalarengu_Fond_horisontaalne.jpg
diff --git a/doc/overview.html b/src/main/doc/overview.html
similarity index 85%
rename from doc/overview.html
rename to src/main/doc/overview.html
index 5b3b9e4fb..0a7772462 100644
--- a/doc/overview.html
+++ b/src/main/doc/overview.html
@@ -28,6 +28,7 @@
Creating and handling signature containers
Using temporary cache files for storing the data file's contents in file system
Adding and removing signatures
Input/output operations with containers
+ Timestamping an ASiCS container
See also: {@link org.digidoc4j.ContainerBuilder org.digidoc4j.ContainerBuilder} and {@link org.digidoc4j.Container}
Creating and handling digital signatures
@@ -37,9 +38,9 @@ Creating and handling digital signatures
Creating the signature's XAdES-based XML contents
Adding meta-data to the signature: e.g. signature creation location and signer's role
- Calculating the hash to be signed - e.g. for calculating the raw signature value with a plug-in in browser
- Calculating the raw RSA signature value
- Adding a raw signature value that is calculated in an external system (e.g. with plugin when signing in browser) to the signature's XML content. Note that this is currently supported only by DDoc.
+ Calculating the hash to be signed - e.g. for calculating the raw signature value with a plug-in in browser
+ Calculating the raw RSA or ECDSA signature value
+ Adding a raw signature value that is calculated in an external system (e.g. with plugin when signing in browser) to the signature's XML content
Adding long term validation data according to the signature profile: either time-mark or time-stamp and OCSP confirmation*
* There are two XAdES-LT level compliant signature profiles supported:
@@ -181,7 +182,7 @@ Creating a container
{@link org.digidoc4j.Container Container} container = {@link org.digidoc4j.ContainerBuilder ContainerBuilder}.
- {@link org.digidoc4j.ContainerBuilder#aContainer(String) aContainer}("BDOC" ). // Supported types are BDOC and DDOC. Default is BDOC
+ {@link org.digidoc4j.ContainerBuilder#aContainer(String) aContainer}("BDOC" ). // Supported types are BDOC, ASICE, ASICS and DDOC. Default is BDOC
{@link org.digidoc4j.ContainerBuilder#withConfiguration(Configuration) withConfiguration}(configuration ). // {@link org.digidoc4j.Configuration} settings
{@link org.digidoc4j.ContainerBuilder#withDataFile(String, String) withDataFile}("testFiles/legal_contract_1.txt" , "text/plain" ). // Adding a document from a hard drive
{@link org.digidoc4j.ContainerBuilder#withDataFile(InputStream, String, String) withDataFile}(inputStream , "legal_contract_2.txt" , "text/plain" ). // Adding a document from a stream
@@ -197,7 +198,7 @@ Creating a container
{@link org.digidoc4j.ContainerBuilder#aContainer(String) ContainerBuilder.aContainer(String containerType)} can be used
- for creating a container of a particular type. Currently supported types are BDOC and DDOC. Default is BDOC 2.1 if no type is provided.
+ for creating a container of a particular type. Currently supported types are BDOC, ASiCE, ASiCS and DDOC. Default is BDOC 2.1 if no type is provided.
Adding data files
@@ -268,8 +269,8 @@ Signing externally
A typical use case would be signing in the Web using a browser plugin:
Create a container with data files
- Calculate a digest of the container to be signed
- Sign the digest externally (e.g. via browser plugin)
+ Create SignedInfo data object what contains a digests of the data files to be signed
+ Sign the SignedInfo data object externally (e.g. via browser plugin)
Finalize the signature with the signature value, OCSP response etc
Add the finalized signature to the container
@@ -283,7 +284,7 @@ Getting data to sign
- Then we need to calculate a digest to be signed externally.
+ Then we need to get the SignedInfo data object to be signed externally.
@@ -296,13 +297,13 @@ Getting data to sign
External signing
- Now we have a digest that can be used for external signing. {@link org.digidoc4j.DataToSign} class contains {@link org.digidoc4j.DataToSign#getDigestToSign} method
- for getting digest to be signed. {@link org.digidoc4j.DataToSign#getDigestAlgorithm} method can be used for getting the digest algorithm to be used in the signing process.
+ Now we have a data that can be used for external signing. {@link org.digidoc4j.DataToSign} class contains {@link org.digidoc4j.DataToSign#getDataToSign} method
+ for getting data to be signed. {@link org.digidoc4j.DataToSign#getDigestAlgorithm} method can be used for getting the digest algorithm to be used in the signing process.
- byte[] digestToSign = dataToSign .{@link org.digidoc4j.DataToSign#getDigestToSign getDigestToSign()}; //Get the digest that should be signed
- byte[] signatureValue = signDigestSomewhereRemotely(digestToSign , DigestAlgorithm.SHA256); //Sign the digest
+ byte[] data = dataToSign .{@link org.digidoc4j.DataToSign#getDataToSign getDataToSign()}; //Get the SignedInfo data that should be signed
+ byte[] signatureValue = signDataSomewhereRemotely(data , DigestAlgorithm.SHA256); //Sign the SignedInfo data
Finalizing signature
@@ -382,19 +383,66 @@ Creating a container
Using the time-mark signature profile
To sign a container using the time-mark protocol you need to specify the signature profile using the -profile option LT_TM:
java -jar digidoc4j-util.jar -in "<output_file_name_and_path>" -add "<input_file_name_and_path>" "<mime_type>" -profile LT_TM -pkcs12 "<pkcs12_token_file>" "<pkcs12_token_password>"
+
+Using the ID-card
+
+java -jar digidoc4j-util.jar -in "<output_file_name_and_path>" -add "<input_file_name_and_path>" "<mime_type>" -profile LT_TM -pkcs11 "<pkcs11_module_path>" "<pkcs11_token_pin_password>" "<pkcs11_slot_index>"
+When the client computer has only one smartcard reader then there are for Estonian ID-card usually two slots available:
+
+
+ slot 0 - for authentication (PIN1)
+ slot 1 - for signing (PIN2)
+
+
+
+ In case where computer has multiple smartcard readers the slot numbers are usable in pairs:
+
+ slot 0 - reader 0, PIN1
+ slot 1 - reader 0, PIN2
+ slot 2 - reader 1, PIN1
+ slot 3 - reader 1, PIN2
+ etc
+
+
+In order to investigate possibilities one can use OpenSC tools, for example:
+
+pkcs11-tool -L --module /usr/local/lib/opensc-pkcs11.so
+Example:
+java -Ddigidoc4j.mode=TEST -jar digidoc4j-util.jar -in test.bdoc -add dds_acrobat.pdf application/pdf -pkcs11 /usr/local/lib/opensc-pkcs11.so 22975 1
Creating multiple signed containers
To create signatures of all the files within a directory, you need to specify the input directory containing data files,
and output directory where the signed containers will be saved.
java -jar digidoc4j-util.jar -inputDir "<input_directory_path>" -mimeType "<mime_type (optional)>" -outputDir "<output_directory_path>" -pkcs11 "<pkcs11_module_path>" "<pkcs11_token_pin_password>" "<pkcs11_slot_index>"
+e-tokens which are bought from SK are initialized in FIPS 140-2 or EAL4+ CC v3.1 rez mode.
+ Thanks to that PIN-code cannot be cached without adding PIN-caching to script. This means that you cannot use -inputDir
,
+ but can use only -in
parameter with those tokens.
+Creating a timestamped ASiCS container
+A valid ASiCS container contains only one document and is signed or timestamped.
+ To create such a container the output file extention must be .asics
or .scs.
+ In order to create ASiCS container with
+ timestamp the option -tst
or -timestamp
must be used:
+
+java -jar digidoc4j-util.jar -in "<output_file_name_and_path>" -add "<input_file_name_and_path>" "<mime_type>" -tst
+NB! For successful timestamping the user must have service agreement with TSA!
+
Validation
-The utility performs validation when specifying the -v option. The output shows all signatures and their statuses as well as all errors:
+The utility performs validation when specifying the -v option. The output shows all signatures and their statuses as well as all errors:
java -jar digidoc4j-util.jar -in "<input_file_name_and_path>" -v
-
In order to see validation warnings in addition to the errors you must specify the -w option:
+In order to see validation warnings in addition to the errors you must specify the -w option:
java -jar digidoc4j-util.jar -in "<input_file_name_and_path>" -v -w
+
In order to get validation reports in addition to the output on the screen you must specify the -r option:
+java -jar digidoc4j-util.jar -in "<input_file_name_and_path>" -v -r "<report_files_path>"
+
Then you can find in given report directory following xml-files: validationReport.xml
, validationDiagnosticData*.xml
,
+ validationDetailReport*.xml
and validationSimpleReport*.xml
.
Verbose
-For all tasks more details can be obtained using the -verbose option as in the next example:
+For all tasks more details can be obtained using the -verbose option as in the next example:
java -jar digidoc4j-util.jar -in "<input_file_name_and_path>" -v -verbose
+
+
Test mode
+It is possible to invoke the library in test mode by adding -Ddigidoc4j.mode=TEST
. This will use the test TSL and accepts test ID cards.
+
+java -Ddigidoc4j.mode=TEST -jar digidoc4j-util.jar