A Java library to parse and verify visible digital seals (VDS) as specified in
- BSI TR-03137 Part 1
- ICAO Doc 9303 Part 13: Visible Digital Seals
- ICAO TR "VDS for Non-Electronic Documents"
Test VDS can be generated with help of the Sealgen tool. There is also the Sealva Android app which scans, verifies and displays all VDS profiles defined in the above specifications.
Here is a quick overview how to use the VDS parser and verifier. When you have the decoded raw string or raw bytes from your favorite datamatrix decoder, just put them to the VDS Tools Dataparser like this:
import de.tsenger.vdstools.DataParser;
import de.tsenger.vdstools.Verifier;
import de.tsenger.vdstools.seals.DigitalSeal;
import de.tsenger.vdstools.seals.VdsType;
import de.tsenger.vdstools.seals.Feature;
...
DigitalSeal digitalSeal = DataParser.parseVdsSeal(rawBytes);
VdsType vdsType = digitalSeal.getVdsType()
// Depending on the returned VDS type you can access the seals content
String mrz = (String) seal.getFeature(Feature.MRZ);
String azr = (String) seal.getFeature(Feature.AZR);
// Get the VDS signer certificate reference
String signerCertRef = digitalSeal.getSignerCertRef();
// Provide for the matching X509 signer certificate
// and use this to verify the VDS signature
Verifier verifier = new Verifier(digitalSeal, x509SignerCert);
Verifier.Result result = verifier.verify();
Also have a look at DataParserTest.java and VerifierTest.java for some more examples.
JavaDoc can be found here:
https://javadoc.jitpack.io/com/github/tsenger/vdstools/latest/javadoc/index.html
https://jitpack.io/#tsenger/vdstools
To include this library to your Gradle build add:
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
and the dependency:
dependencies {
implementation 'com.github.tsenger:vdstools:0.2.1'
}
To include this library to your Maven build add:
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
and the dependency:
<dependency>
<groupId>com.github.tsenger</groupId>
<artifactId>vdstools</artifactId>
<version>0.2.1</version>
</dependency>