eGov Validation Client SDK

The eGov Validation Client SDK provides Java classes to use as a client for the eGov validation service.

Requirements

Java Runtime Environment

The target Java runtime version for the validation client library is 17.

Security Provider

The validation client SDK uses the SHA-256 hash algorithm, which is not available from the default Java security provider. To use the validation client SDK, install a security provider that provides the SHA-256 hash algorithm, such as the Bouncycastle security provider.

Logging

The validation client SDK uses SLF4J for logging. To get logging output from the validation client SDK, make sure you have a usable SLF4J backend.

API examples

Validating all signatures in a file

This example assumes that
FileRequest fileRequest = new FileRequest(pdfFile, client);
ValidationServiceClient serviceClient = ValidationServiceClientBuilder.newBuilder() //
		.serviceUrl(serviceUrl) //
		.build();
ValidationResponse response = serviceClient.validateOneRequest(Arrays.asList(fileRequest), false, null, null, "de", null);
	

Validating a single signature in a file

This example assumes that
ValidationServiceClient serviceClient = ValidationServiceClientBuilder.newBuilder() //
		.serviceUrl(serviceUrl) //
		.build();
ValidationResponse response = serviceClient.validateOneSignature(pdfBytes, client, false, sigName,
		"file.pdf", null, null, "de", null);
	

Creating a validation report

This example assumes that
FileRequest fileRequest = new FileRequest(pdfFile, client);
ValidationServiceClient serviceClient = ValidationServiceClientBuilder.newBuilder() //
		.serviceUrl(serviceUrl) //
		.build();
ValidationResponse response = serviceClient.validateOneRequest(Arrays.asList(fileRequest), true, null, null, "de", "report.pdf");
File file = new File(response.getPdfOutputFileName());
try (OutputStream stream = new FileOutputStream(file)) {
	stream.write(response.getPdfReport());
}
	

Validating all signatures in a batch of files

This example assumes that
FileRequest fileRequest1 = new FileRequest(pdfFile1, client);
FileRequest fileRequest2 = new FileRequest(pdfFile2, client);
ValidationServiceClient serviceClient = ValidationServiceClientBuilder.newBuilder() //
		.serviceUrl(serviceUrl) //
		.build();
ValidationResponse response = serviceClient.validateOneRequest(Arrays.asList(fileRequest1, fileRequest2), false, null, null, "de", null);
	

API reference

The API reference for the validation client SDK is provided via Javadoc.