tsenger / vdstools

A library to parse and verify Visible Digital Seals (VDS)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

VdsTools - lib to parse and verify Visible Digital Seals

A Java library to parse and verify visible digital seals (VDS) as specified in

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.

Get it on Google Play

How to use

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.

Documentation

JavaDoc can be found here:

https://javadoc.jitpack.io/com/github/tsenger/vdstools/latest/javadoc/index.html

How to include

https://jitpack.io/#tsenger/vdstools

Release

Gradle

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'
}

Maven

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>

About

A library to parse and verify Visible Digital Seals (VDS)

License:Apache License 2.0


Languages

Language:Java 100.0%