diggsweden / dgc-java Goto Github PK
View Code? Open in Web Editor NEWJava implementation of the EU eHealth Digital Green Certificates.
License: MIT License
Java implementation of the EU eHealth Digital Green Certificates.
License: MIT License
Make a Java 8 build profile i the pom and deliver the artifact with the suffix j8.
Since testing should be performed using version 1.0.0 we should have better ways to choose which schema version to use.
1.1.0 schema has been released. We should update dgc-java to reflect the changes.
The DefaultDGCDecoder (https://diggsweden.github.io/dgc-java/javadoc/dgc-create-validate/se/digg/dgc/service/impl/DefaultDGCDecoder.html) needs a CertificateProvider. This, however, is only given as interface. An actual implementation which returns the needed certificates for the countries and most importantly documentation where to get the certificates is missing.
On request of the danish team we remove the Maven dependencies to the QR-code library zxing optional.
I am using spring boot 1.3.2.RELEASE and dgc-create-validate(java8) and dgc-schema(java8)
When creating a DigitalCovidCertificate object it throws "java.lang.VerifyError: Cannot inherit from final class"
However, running the same code on a newer spring boot version(2.6.6), it seems to work just fine.
Code:
DigitalCovidCertificate dgc = (DigitalCovidCertificate) new DigitalCovidCertificate()
.withNam(new PersonName().withGn("Martin").withFn("Lindstr�m"))
.withDob("1969-11-11")
.withV(Arrays.asList(new VaccinationEntry()
.withTg("840539006")
.withVp("1119349007")
.withMp("EU/1/20/1507")
.withMa("ORG-100030215")
.withDn(Integer.valueOf(1))
.withSd(Integer.valueOf(2))
.withDt(LocalDate.parse("2021-04-17"))
.withCo("SE")
.withIs("Swedish eHealth Agency")
.withCi("01:SE:JKJKHJGHG6768686HGJGH#M")));
Exception:
java.lang.VerifyError: Cannot inherit from final class
at java.lang.ClassLoader.defineClass1(Native Method) ~[na:1.8.0_211]
at java.lang.ClassLoader.defineClass(ClassLoader.java:763) ~[na:1.8.0_211]
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) ~[na:1.8.0_211]
at java.net.URLClassLoader.defineClass(URLClassLoader.java:468) ~[na:1.8.0_211]
at java.net.URLClassLoader.access$100(URLClassLoader.java:74) ~[na:1.8.0_211]
at java.net.URLClassLoader$1.run(URLClassLoader.java:369) ~[na:1.8.0_211]
at java.net.URLClassLoader$1.run(URLClassLoader.java:363) ~[na:1.8.0_211]
at java.security.AccessController.doPrivileged(Native Method) ~[na:1.8.0_211]
at java.net.URLClassLoader.findClass(URLClassLoader.java:362) ~[na:1.8.0_211]
at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[na:1.8.0_211]
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349) ~[na:1.8.0_211]
at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[na:1.8.0_211]
at com.example.demo.controller.EuController.getQr(EuController.java:70) ~[classes/:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_211]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_211]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_211]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_211]
at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:222) ~[spring-web-4.2.4.RELEASE.jar:4.2.4.RELEASE]
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:137) ~[spring-web-4.2.4.RELEASE.jar:4.2.4.RELEASE]
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:110) ~[spring-webmvc-4.2.4.RELEASE.jar:4.2.4.RELEASE]
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:814) ~[spring-webmvc-4.2.4.RELEASE.jar:4.2.4.RELEASE]
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:737) ~[spring-webmvc-4.2.4.RELEASE.jar:4.2.4.RELEASE]
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85) ~[spring-webmvc-4.2.4.RELEASE.jar:4.2.4.RELEASE]
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:959) ~[spring-webmvc-4.2.4.RELEASE.jar:4.2.4.RELEASE]
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:893) ~[spring-webmvc-4.2.4.RELEASE.jar:4.2.4.RELEASE]
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:969) ~[spring-webmvc-4.2.4.RELEASE.jar:4.2.4.RELEASE]
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:860) ~[spring-webmvc-4.2.4.RELEASE.jar:4.2.4.RELEASE]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:622) ~[tomcat-embed-core-8.0.30.jar:8.0.30]
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:845) ~[spring-webmvc-4.2.4.RELEASE.jar:4.2.4.RELEASE]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729) ~[tomcat-embed-core-8.0.30.jar:8.0.30]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:291) ~[tomcat-embed-core-8.0.30.jar:8.0.30]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) ~[tomcat-embed-core-8.0.30.jar:8.0.30]
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) ~[tomcat-embed-websocket-8.0.30.jar:8.0.30]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239) ~[tomcat-embed-core-8.0.30.jar:8.0.30]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) ~[tomcat-embed-core-8.0.30.jar:8.0.30]
at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:99) ~[spring-web-4.2.4.RELEASE.jar:4.2.4.RELEASE]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-4.2.4.RELEASE.jar:4.2.4.RELEASE]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239) ~[tomcat-embed-core-8.0.30.jar:8.0.30]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) ~[tomcat-embed-core-8.0.30.jar:8.0.30]
at org.springframework.web.filter.HttpPutFormContentFilter.doFilterInternal(HttpPutFormContentFilter.java:87) ~[spring-web-4.2.4.RELEASE.jar:4.2.4.RELEASE]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-4.2.4.RELEASE.jar:4.2.4.RELEASE]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239) ~[tomcat-embed-core-8.0.30.jar:8.0.30]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) ~[tomcat-embed-core-8.0.30.jar:8.0.30]
at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:77) ~[spring-web-4.2.4.RELEASE.jar:4.2.4.RELEASE]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-4.2.4.RELEASE.jar:4.2.4.RELEASE]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239) ~[tomcat-embed-core-8.0.30.jar:8.0.30]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) ~[tomcat-embed-core-8.0.30.jar:8.0.30]
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:121) ~[spring-web-4.2.4.RELEASE.jar:4.2.4.RELEASE]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-4.2.4.RELEASE.jar:4.2.4.RELEASE]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239) ~[tomcat-embed-core-8.0.30.jar:8.0.30]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) ~[tomcat-embed-core-8.0.30.jar:8.0.30]
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:212) ~[tomcat-embed-core-8.0.30.jar:8.0.30]
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106) [tomcat-embed-core-8.0.30.jar:8.0.30]
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502) [tomcat-embed-core-8.0.30.jar:8.0.30]
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141) [tomcat-embed-core-8.0.30.jar:8.0.30]
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79) [tomcat-embed-core-8.0.30.jar:8.0.30]
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88) [tomcat-embed-core-8.0.30.jar:8.0.30]
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:521) [tomcat-embed-core-8.0.30.jar:8.0.30]
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1096) [tomcat-embed-core-8.0.30.jar:8.0.30]
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:674) [tomcat-embed-core-8.0.30.jar:8.0.30]
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1500) [tomcat-embed-core-8.0.30.jar:8.0.30]
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1456) [tomcat-embed-core-8.0.30.jar:8.0.30]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_211]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0_211]
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-embed-core-8.0.30.jar:8.0.30]
at java.lang.Thread.run(Thread.java:748) [na:1.8.0_211]
We should split the contents of this repo into two separate artifacts:
The credentials-support dependency will pull Spring dependencies. Make Spring optional for those not making use of these features of credentials-support.
See #22
On request of the danish team we remove the use of Lombok.
As added by ehn-dcc-development/eu-dcc-schema#67
Hi @martin-lindstrom -
Should we align the efforts with your impl and the impl at https://github.com/ehn-digital-green-development/hcert-java
Test testSimpleCreate in DefaultBarcodeCreatorTest fails on any computer running a system characterset other than "Latin I". This is due to combination of character Ö being available in simple charset of "Latin I" but not being available in other simple charsets.
I tried using UTF-8 encoding both in literal values as well as in building the QR code, but was unsuccessful.
For some exports we need the barcode image in SVG ...
Since validation certificates may have a usage (vac, test, recovery), we need to extend the CertificateProvider
interface and also have an extra parameter for validate telling the usage.
Here in Hungary, our central national healthcare backend still runs on Java 1.8 so we cannot integrate dgc-java compiled against Java 11
Running mvn clean install
on
Apache Maven 3.6.3
Maven home: /usr/share/maven
Java version: 15.0.2, vendor: Oracle Corporation, runtime: /usr/lib/jvm/java-15-oracle
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "5.8.0-55-generic", arch: "amd64", family: "unix"
fails with these errors:
[INFO]
[INFO] --- maven-clean-plugin:3.1.0:clean (default-clean) @ dgc-create-validate ---
[INFO]
[INFO] --- maven-enforcer-plugin:3.0.0-M3:enforce (enforce) @ dgc-create-validate ---
[INFO] artifact net.minidev:json-smart: checking for updates from central
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ dgc-create-validate ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /home/martin/repos/dgc-java/create-validate/src/main/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) @ dgc-create-validate ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 39 source files to /home/martin/repos/dgc-java/create-validate/target/classes
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ dgc-create-validate ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 60 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.8.1:testCompile (default-testCompile) @ dgc-create-validate ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 17 source files to /home/martin/repos/dgc-java/create-validate/target/test-classes
[INFO]
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ dgc-create-validate ---
[INFO] Surefire report directory: /home/martin/repos/dgc-java/create-validate/target/surefire-reports
-------------------------------------------------------
T E S T S
-------------------------------------------------------
Running se.digg.dgc.cwt.support.CBORInstantConverterTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.121 sec
Running se.digg.dgc.cwt.CwtTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.009 sec
Running se.digg.dgc.encoding.ZlibTest
Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.008 sec
Running se.digg.dgc.encoding.impl.DefaultBarcodeCreatorTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.335 sec
Running se.digg.dgc.encoding.Base45Test
Tests run: 10, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.036 sec
Running se.digg.dgc.service.impl.DefaultDGCBarcodeEncoderDecoderTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.1 sec
Running se.digg.dgc.interop.InteropTest
Tests run: 32, Failures: 4, Errors: 0, Skipped: 0, Time elapsed: 1.022 sec <<< FAILURE!
validate[17](se.digg.dgc.interop.InteropTest) Time elapsed: 0.018 sec <<< FAILURE!
java.lang.AssertionError: [SI-1]: Signature validation check failed - Signature verification failed for all attempted certificates
at org.junit.Assert.fail(Assert.java:89)
at se.digg.dgc.interop.DGCTestDataVerifier.validateExpirationAndSignature(DGCTestDataVerifier.java:379)
at se.digg.dgc.interop.DGCTestDataVerifier.validate(DGCTestDataVerifier.java:128)
at se.digg.dgc.interop.InteropTest.validate(InteropTest.java:147)
at jdk.internal.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:564)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:59)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:56)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
at org.junit.runners.BlockJUnit4ClassRunner$1.evaluate(BlockJUnit4ClassRunner.java:100)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:366)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:103)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:63)
at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329)
at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293)
at org.junit.runners.ParentRunner.run(ParentRunner.java:413)
at org.junit.runners.Suite.runChild(Suite.java:128)
at org.junit.runners.Suite.runChild(Suite.java:27)
at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329)
at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293)
at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
at org.junit.runners.ParentRunner.run(ParentRunner.java:413)
at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:564)
at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)
validate[18](se.digg.dgc.interop.InteropTest) Time elapsed: 0.012 sec <<< FAILURE!
java.lang.AssertionError: [SI-2]: Signature validation check failed - Signature verification failed for all attempted certificates
at org.junit.Assert.fail(Assert.java:89)
at se.digg.dgc.interop.DGCTestDataVerifier.validateExpirationAndSignature(DGCTestDataVerifier.java:379)
at se.digg.dgc.interop.DGCTestDataVerifier.validate(DGCTestDataVerifier.java:128)
at se.digg.dgc.interop.InteropTest.validate(InteropTest.java:147)
at jdk.internal.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:564)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:59)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:56)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
at org.junit.runners.BlockJUnit4ClassRunner$1.evaluate(BlockJUnit4ClassRunner.java:100)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:366)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:103)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:63)
at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329)
at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293)
at org.junit.runners.ParentRunner.run(ParentRunner.java:413)
at org.junit.runners.Suite.runChild(Suite.java:128)
at org.junit.runners.Suite.runChild(Suite.java:27)
at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329)
at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293)
at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
at org.junit.runners.ParentRunner.run(ParentRunner.java:413)
at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:564)
at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)
validate[20](se.digg.dgc.interop.InteropTest) Time elapsed: 0.013 sec <<< FAILURE!
java.lang.AssertionError: [SI-4]: Signature validation check failed - Signature verification failed for all attempted certificates
at org.junit.Assert.fail(Assert.java:89)
at se.digg.dgc.interop.DGCTestDataVerifier.validateExpirationAndSignature(DGCTestDataVerifier.java:379)
at se.digg.dgc.interop.DGCTestDataVerifier.validate(DGCTestDataVerifier.java:128)
at se.digg.dgc.interop.InteropTest.validate(InteropTest.java:147)
at jdk.internal.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:564)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:59)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:56)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
at org.junit.runners.BlockJUnit4ClassRunner$1.evaluate(BlockJUnit4ClassRunner.java:100)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:366)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:103)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:63)
at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329)
at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293)
at org.junit.runners.ParentRunner.run(ParentRunner.java:413)
at org.junit.runners.Suite.runChild(Suite.java:128)
at org.junit.runners.Suite.runChild(Suite.java:27)
at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329)
at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293)
at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
at org.junit.runners.ParentRunner.run(ParentRunner.java:413)
at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:564)
at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)
validate[21](se.digg.dgc.interop.InteropTest) Time elapsed: 0.012 sec <<< FAILURE!
java.lang.AssertionError: [SI-5]: Signature validation check failed - Signature verification failed for all attempted certificates
at org.junit.Assert.fail(Assert.java:89)
at se.digg.dgc.interop.DGCTestDataVerifier.validateExpirationAndSignature(DGCTestDataVerifier.java:379)
at se.digg.dgc.interop.DGCTestDataVerifier.validate(DGCTestDataVerifier.java:128)
at se.digg.dgc.interop.InteropTest.validate(InteropTest.java:147)
at jdk.internal.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:564)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:59)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:56)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
at org.junit.runners.BlockJUnit4ClassRunner$1.evaluate(BlockJUnit4ClassRunner.java:100)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:366)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:103)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:63)
at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329)
at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293)
at org.junit.runners.ParentRunner.run(ParentRunner.java:413)
at org.junit.runners.Suite.runChild(Suite.java:128)
at org.junit.runners.Suite.runChild(Suite.java:27)
at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329)
at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293)
at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
at org.junit.runners.ParentRunner.run(ParentRunner.java:413)
at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:564)
at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)
Running se.digg.dgc.interop.CreateTestDataTest
Writing testfile /home/martin/repos/dgc-java/create-validate/target/interop/2.json
Writing testfile /home/martin/repos/dgc-java/create-validate/target/interop/3.json
Writing testfile /home/martin/repos/dgc-java/create-validate/target/interop/1.json
Writing testfile /home/martin/repos/dgc-java/create-validate/target/interop/4.json
Writing testfile /home/martin/repos/dgc-java/create-validate/target/interop/5.json
Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.341 sec
Running se.digg.dgc.uvci.UVCIBuilderTest
Tests run: 22, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.015 sec
Running se.digg.dgc.uvci.UVCIChecksumCalculatorTest
Tests run: 5, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.51 sec
Running se.digg.dgc.cose.CoseSign1_ObjectTest
Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.048 sec
Running se.digg.dgc.cose.SignatureAlgorithmTest
Tests run: 6, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.005 sec
Results :
Failed tests: validate[17](se.digg.dgc.interop.InteropTest): [SI-1]: Signature validation check failed - Signature verification failed for all attempted certificates
validate[18](se.digg.dgc.interop.InteropTest): [SI-2]: Signature validation check failed - Signature verification failed for all attempted certificates
validate[20](se.digg.dgc.interop.InteropTest): [SI-4]: Signature validation check failed - Signature verification failed for all attempted certificates
validate[21](se.digg.dgc.interop.InteropTest): [SI-5]: Signature validation check failed - Signature verification failed for all attempted certificates
Tests run: 89, Failures: 4, Errors: 0, Skipped: 0
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for DIGG :: EU Digital Covid Certificate :: DCC Java 1.0.1:
[INFO]
[INFO] DIGG :: EU Digital Covid Certificate :: DCC Java ... SUCCESS [ 1.580 s]
[INFO] DIGG :: EU Digital Covid Certificate :: DCC Schema . SUCCESS [ 9.099 s]
[INFO] DIGG :: EU Digital Covid Certificate :: Issuance and Validation FAILURE [ 32.281 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 43.099 s
[INFO] Finished at: 2021-06-20T12:54:07+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test (default-test) on project dgc-create-validate: There are test failures.
[ERROR]
[ERROR] Please refer to /home/martin/repos/dgc-java/create-validate/target/surefire-reports for the individual test results.
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <args> -rf :dgc-create-validate
Any help apprechiated.
Should this project be updated with the schemas from https://github.com/ehn-digital-green-development/ehn-dgc-schema instead of using the one from https://github.com/ehn-digital-green-development/hcert-schema/blob/main/eu_dgc_v1_schema.json ?
DGCBarcodeDecoder fails to decode a valid test result which is created using "1.0.0" schema. In particular, field "dr" (Date/Time of Test Result) was valid, but optional field in schema "1.0.0", it is removed in schema "1.3.0". As a result, the decoder now fails. Would it be possible/feasible to support older schemas in addition to "1.3.0"?
Exception
se.digg.dgc.payload.v1.DGCSchemaException: Failed to decode DCC from CBOR encoding
at se.digg.dgc.payload.v1.DigitalCovidCertificate.decode(DigitalCovidCertificate.java:258) ~[dgc-schema-1.0.1.jar:na]
at se.digg.dgc.service.impl.DefaultDGCDecoder.decode(DefaultDGCDecoder.java:71) ~[dgc-create-validate-1.0.1.jar:na]
UnrecognizedPropertyException: Unrecognized field "dr" (class se.digg.dgc.payload.v1.TestEntry), not marked as ignorable (10 known properties: "tt", "tg", "ma", "ci", "is", "co", "tr", "nm", "sc", "tc"])"
Test data
https://github.com/eu-digital-green-certificates/dgc-testdata/blob/main/BG/2DCode/raw/5.json
Schemas
1.0.0: https://github.com/ehn-dcc-development/ehn-dcc-schema/blob/release/1.0.0/DGC.combined-schema.json
1.3.0 (dr is missing): https://github.com/ehn-dcc-development/ehn-dcc-schema/blob/release/1.3.0/DCC.combined-schema.json
In the java docs https://diggsweden.github.io/dgc-java/javadoc/dgc-create-validate/se/digg/dgc/service/DGCDecoder.html
The links to the DigitalCovidCertificate class (https://github.com/diggsweden/dgc-java/apidocs/se/digg/dgc/payload/v1/DigitalCovidCertificate.html?is-external=true) are not existing / broken.
We should rename the repo and many of the terms in it that refer to hcert to dgc (digital green certificate)
Hi, is this library affected by GHSA-fj2w-wfgv-mwq6 ?
We are using dgc-java in Slovenia, forked at https://github.com/ixtlan-team/dgc-java
We have prepared the DGCs and found that for "test" DGCs that include sc field, we get a value of:
"sc": "2021-06-04T10:46:25.619935900Z"
This value is not well recieved by the verification app, as fraction has too many digits (9).
We have also found that in samples submitted by SE, value is
'"sc": "2021-06-02T06:02:13.262564Z"'
This value is correct, it has 6 digits in fraction.
You can disregard this issue and mark it closed and we will try and resolve the issue on our own. But if you feel that you want this resolved for you as well, then let us know, what the preffered way would be.
From what we found the correct way would be to fix the 'ObjectMapper jsonMapper' in 'DigitalCovidCertificate'.
Alternative would be to add JsonFormatter to the Instant field in 'TestStatement'
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.