Introduction

Purpose of the document

This document describes some examples of how to develop in Java using the DSS framework. The aim is to show to the developers, in a progressive manner, the different uses of the framework. It will familiarise them with the code step by step.

Scope of the document

This document provides examples of code which allow easy handling of digital signatures. The examples are consistent with the Release 5.1 of DSS framework which can be downloaded via https://ec.europa.eu/cefdigital/wiki/display/CEFDIGITAL/DSS+-+releases

Three main features can be distinguished within the framework :

  • The digital signature;

  • The extension of a digital signature and;

  • The validation of a digital signature.

On a more detailed manner the following concepts and features are addressed in this document:

  • Formats of the signed documents: XML, PDF, DOC, TXT, ZIP…​;

  • Packaging structures: enveloping, enveloped and detached;

  • Forms of digital signatures: XAdES, CAdES, PAdES and ASiC;

  • Profiles associated to each form of the digital signature;

  • Trust management;

  • Revocation data handling (OCSP and CRL sources);

  • Certificate chain building;

  • Signature validation and validation policy;

  • Validation of the signing certificate.

This is not an exhaustive list of all the possibilities offered by the framework and the proposed examples cover only the most useful features. However, to discover every detail of the operational principles of the framework, the JavaDoc is available within the source code.

Please note that the DSS framework is still under maintenance and new features will be released in the future.

Abbreviations and Acronyms

Code

Description

AdES

Advanced Electronic Signature

API

Application Programming Interface

ASiC

Associated Signature Containers

BB

Building Block (CEF)

CA

Certificate authority

CAdES

CMS Advanced Electronic Signatures

CD

Commission Decision

CEF

Connecting Europe Facility

CMS

Cryptographic Message Syntax

CRL

Certificate Revocation List

CSP

Core Service Platform (CEF)

CSP

Cryptographic Service Provider

DER

Distinguished Encoding Rules

DSA

Digital Signature Algorithm - an algorithm for public-key cryptography

DSI

Digital Service Infrastructure (CEF)

DSS

Digital Signature Service

EC

European Commission

eID

Electronic Identity Card

ESI

Electronic Signatures and Infrastructures

ETSI

European Telecommunications Standards Institute

EUPL

European Union Public License

FSF

Free Software Foundation

GS

Generic Service (CEF)

GUI

Graphical User Interface

HSM

Hardware Security Modules

HTTP

Hypertext Transfer Protocol

I18N

Internationalisation

Java EE

Java Enterprise Edition

JavaDoc

JavaDoc is developed by Sun Microsystems to create API documentation in HTML format from the comments in the source code. JavaDoc is an industrial standard for documenting Java classes.

JAXB

Java Architecture for XML Binding

JCA

Java Cryptographic Architecture

JCE

Java Cryptography Extension

JDBC

Java DataBase Connectivity

LGPL

Lesser General Public License

LOTL

List of Trusted List or List of the Lists

LSP

Large Scale Pilot

MIT

Massachusetts Institute of Technology

MOCCA

Austrian Modular Open Citizen Card Architecture; implemented in Java

MS / EUMS

Member State

MS CAPI

Microsoft Cryptographic Application Programming Interface

OCF

OEBPS Container Format

OCSP

Online Certificate Status Protocol

ODF

Open Document Format

ODT

Open Document Text

OEBPS

Open eBook Publication Structure

OID

Object Identifier

OOXML

Office Open XML

OSI

Open Source Initiative

OSS

Open Source Software

PAdES

PDF Advanced Electronic Signatures

PC/SC

Personal computer/Smart Card

PDF

Portable Document Format

PDFBox

Apache PDFBox - A Java PDF Library: http://pdfbox.apache.org/

PKCS

Public Key Cryptographic Standards

PKCS#12

It defines a file format commonly used to store X.509 private key accompanying public key certificates, protected by symmetrical password

PKIX

Internet X.509 Public Key Infrastructure

RSA

Rivest Shamir Adleman - an algorithm for public-key cryptography

SCA

Signature Creation Application

SCD

Signature Creation Device

SME

Subject Matter Expert

SMO

Stakeholder Management Office (CEF)

SOAP

Simple Object Access Protocol

SSCD

Secure Signature-Creation Device

SVA

Signature Validation Application

TL

Trusted List

TLManager

Application for managing trusted lists.

TSA

Time Stamping Authority

TSL

Trust-service Status List

TSP

Time Stamp Protocol

TSP

Trusted Service Provider

TST

Time-Stamp Token

UCF

Universal Container Format

URI

Uniform Resource Identifier

WSDL

Web Services Description Language

WYSIWYS

What you see is what you sign

XAdES

XML Advanced Electronic Signatures

XML

Extensible Markup Language

ZIP

File format used for data compression and archiving

References

Ref.

Title

Reference

Version

R01

ESI - XAdES digital signatures

ETSI EN 319 132 part 1-2

1.0.0

R02

ESI - CAdES digital signatures

ETSI EN 319 122 part 1-2

1.1.1

R03

ESI - PAdES digital signatures

ETSI EN 319 142 part 1-2

1.1.1

R04

ESI - Associated Signature Containers (ASiC)

ETSI EN 319 162 part 1-2

1.1.1

R05

Document management - Portable document format - Part 1: PDF 1.7

ISO 32000-1

1

R06

Directive 1999/93/EC of the European Parliament and of the Council of 13 December 1999 on a Community framework for electronic signatures.

DIRECTIVE 1999/93/EC

R07

Internet X.509 Public Key Infrastructure - Time-Stamp Protocol (TSP)

RFC 3161

R08

ESI - Procedures for Creation and Validation of AdES Digital Signatures

ETSI EN 319 102-1

1.0.0

General framework structure

DSS framework is a multi-modules project which can be builded with Maven.

You can easily download them with the following Maven repository :

<repository>
  <id>cefdigital</id>
  <name>cefdigital</name>
  <url>https://ec.europa.eu/cefdigital/artifact/content/repositories/esignaturedss/</url>
</repository>
dss-model

Data model used in almost every modules.

dss-token

Token definitions and implementations for MS CAPI, PKCS#11, PKCS#12.

dss-document

Common module to sign and validate document. This module doen’t contain any implementation.

dss-asic-common

Common code which is shared between dss-asic-xades and dss-asic-cades.

dss-asic-cades

Implementation of the ASiC-S and ASiC-E signature, extension and validation based on CAdES signatures.

dss-asic-xades

Implementation of the ASiC-S and ASiC-E signature, extension and validation based on XAdES signatures.

dss-cades

Implementation of the CAdES signature, extension and validation.

dss-pades

Implementation of the PAdES signature, extension and validation.

dss-xades

Implementation of the XAdES signature, extension and validation.

dss-spi

Interfaces, util classes to manipulate ASN1, compute digests,…​

dss-service

Implementations to communicate with online resources (TSP, CRL, OCSP).

dss-tsl-validation

Module which allows to load / parse / validate LOTL and TSLs.

validation-policy

Business of the signature’s validation (ETSI EN 319 102).

dss-rest

REST webservices to sign (getDataToSign, signDocument methods) and extend a signature.

dss-rest-client

Client for the REST webservices.

dss-soap

SOAP webservices to sign (getDataToSign, signDocument methods) and extend a signature.

dss-soap-client

Client for the SOAP webservices.

dss-validation-rest

REST webservices to validate a signature.

dss-validation-rest-client

Client for the REST webservices.

dss-validation-soap

SOAP webservices to validate a signature.

dss-validation-soap-client

Client for the SOAP webservices.

dss-remote-services

Common code between dss-rest and dss-soap.

dss-server-signing-common

Common code for server signing

dss-server-signing-rest

REST webservice for server signing

dss-server-signing-rest-client

REST client for server signing

dss-server-signing-soap

SOAP webservice for server signing

dss-server-signing-soap-client

SOAP client for server signing

sscd-mocca-adapter

Implementation for MOCCA token.

dss-policy-jaxb

JAXB model of the validation policy.

dss-diagnostic-jaxb

JAXB model of the diagnostic data.

dss-simple-report-jaxb

JAXB model of the simple report.

dss-detailed-report-jaxb

JAXB model of the detailed report.

dss-reports

Wrappers to easily manipulate the reports JAXB models (diagnostic-data, simple-report, detailed-report).

dss-tsl-jaxb

JAXB model of the TSL.

dss-utils

API with utility methods for String, Collection, I/O,…​

dss-utils-apache-commons

Implementation of dss-utils with Apache Commons libraries

dss-utils-google-guava

Implementation of dss-utils with Google Guava

dss-test

Mocks and util classes for unit tests.

dss-cookbook

Samples and documentation of DSS used to generate this documentation.

DSS Utils

The module dss-utils offers an interface with utility methods to operate on String, Collection, I/O,…​ DSS framework provides two different implementations with the same behavior :

  • dss-utils-apache-commons : this module uses Apache Commons libraries (commons-lang3, commons-collection4, commons-io and commons-codec);

  • dss-utils-google-guava : this module only requires Google Guava (recommended on Android).

If your integration includes dss-utils, you will needs to select an implementation.

Available demonstrations

With the framework, some demonstrations are provided.

dss-standalone-app

Standalone application which allows to sign a document with different formats and tokens (JavaFX).

dss-standalone-app-package

Packaging module for dss-standalone-app.

dss-demo-webapp

Demonstration web application which presents a part of the DSS possibilities.

dss-demo-bundle

Packaging module for dss-demo-webapp.

Signature’s profile simplification

The different formats of the digital signature make possible to cover a wide range of real live cases of use of this technique. Thus we distinguish the following formats: XAdES, CAdES, PAdES and ASIC. To each one of them a specific standard is dedicated. The wide variety of options, settings and versions of the standards makes their interoperability very difficult. This is the main reason for which new standards commonly called "baseline profiles" were published. Their goal is to limit the number of options and variants thereby making possible a better interoperability between different actors.

In general can be said that for each format of the digital signature the number of security levels defined in the new standards has been reduced. Below is a comparative table of old and new levels for each format of the signature:

XAdES

CAdES

PAdES

STANDARD

BASELINE

STANDARD

BASELINE

STANDARD

BASELINE

XAdES-BES

XAdES-B

CAdES-BES

CAdES-B

PAdES-BES

PAdES-B

XAdES-EPES

CAdES-EPES

PAdES-EPES

XAdES-T

XAdES-T

CAdES-T

CAdES-T

PAdES-T

PAdES-T

XAdES-XL

XAdES-LT

CAdES-XL

CAdES-LT

PAdES-XL

PAdES-LT

XAdES-A

XAdES-LTA

CAdES-A

CAdES-LTA

PAdES-LTV

PAdES-LTA

Note that the new version (v4) of the DSS framework is compatible with the baseline profiles, it is no longer possible to use the standard profiles for signing purpose. The validation of the signature still takes into account the old profiles.

The XML Signature (XAdES)

The simplest way to address the digital signature passes through the XAdES format. Indeed, it allows to visualize the content of the signature with a simple text editor. Thus it becomes much easier to make the connection between theoretical concepts and their implementation. Before embarking on the use of the DSS framework, it is advisable to read the following documents:

  • XAdES Specifications (cf. [R01])

After reading these documents, it is clear that:

  • To electronically sign a document, a signing certificate (that proves the signer’s identity) and the access to its associated private key is needed.

  • To electronically validate a signed document the signer’s certificate containing the public key is needed. To give a more colourful example: when a digitally signed document is sent to a given person or organization in order to be validated, the certificate with the public key used to create the signature must also be provided.

XAdES Profiles

The new ETSI standard defines four conformance levels to address the growing need to protect the validity of the signature in time. Henceforth to denote the level of the signature the word "level" will be used. Follows the list of levels defined in the standard:

  • XAdES-BASELINE-B: Basic Electronic Signature The lowest and simplest version just containing the SignedInfo, SignatureValue, KeyInfo and SignedProperties. This level combines the old -BES and -EPES levels. This form extends the definition of an electronic signature to conform to the identified signature policy.

  • XAdES-BASELINE-T: Signature with a timestamp A timestamp regarding the time of signing is added to protect against repudiation.

  • XAdES-BASELINE-LT: Signature with Long Term Data Certificates and revocation data are embedded to allow verification in future even if their original source is not available. This level is equivalent to the old -XL level.

  • XAdES-BASELINE-LTA: Signature with Long Term Data and Archive timestamp By using periodical timestamping (e.g. each year) compromising is prevented which could be caused by weakening previous signatures during a long-time storage period. This level is equivalent to the old -A level.

Note
Old levels: -BES, -EPES, -C, -X, -XL, -A are not supported any more when signing.

XAdES-BASELINE-B

To start, let’s take a simple XML document:

xml_example.xml
<?xml version="1.0"?>
<test>Hello World !</test>

Since this is an XML document, we will use the XAdES signature and more particularly XAdES-BASELINE-B level, which is the lowest level of protection: just satisfying Directive (cf. [R06]) legal requirements for advanced signature. The normal process of signing wants to sign first with the level -B or level-T, and then later when it becomes necessary to complete the signature with superior levels. However, the framework allows signing directly with any level. When signing data, the resulting signature needs to be linked with the data to which it applies. This can be done either by creating a data set which combines the signature and the data (e.g. by enveloping the data with the signature or including a signature element in the data set) or placing the signature in a separate resource and having some external means for associating the signature with the data. So, we need to define the packaging of the signature, namely ENVELOPED, ENVELOPING or DETACHED.

  • ENVELOPED : when the signature applies to data that surround the rest of the document;

  • ENVELOPING : when the signed data form a sub-element of the signature itself;

  • DETACHED : when the signature relates to the external resources separated from it.

For our example, we will use ENVELOPED packaging.

The DSS framework uses 3 atomic steps to sign a document :

  1. Compute the digest to be signed;

  2. Sign the digest;

  3. Sign the document (add the signed digest).

The DSS fully manages the steps 1 and 3. We need to specify how to do the signature operation. DSS offers some implementations in the dss-token module

To write our Java code, we still need to specify the type of KeyStore to use for signing our document, more simply, where the private key can be found. In the package "eu.europa.esig.dss.token", we can choose between different connection tokens :

  • Pkcs11SignatureToken : allows to communicate with SmartCards with the PKCS#11 interface. It requires some installed drivers (dll, sso,…​)

  • Pkcs12SignatureToken : allows to sign with a PKC#12 keystore (.p12 file).

  • MSCAPISignatureToken : handles the signature with MS CAPI (the Microsoft interface to communicate with SmartCards).

  • JKSSignatureToken : allows to sign with a Java Key Store (.jks file).

Note
The DSS also provides the support for MOCCA framework to communicate with the Smartcard with PC/SC, but it involves the installation of the MOCCA and IAIK libraries.

To know more about the use of the different signature tokens, please consult "Management of Signature Tokens" chapter.

In our example the class: "Pkcs12SignatureToken" will be used. A file in PKCS#12 format must be provided to the constructor of the class. It contains an X.509 private key accompanying the public key certificate and protected by symmetrical password. The certification chain can also be included in this file. It is possible to generate dummy certificates and their chains with OpenSSL. Please visit http://www.openssl.org/ for more details.

This is the complete code that allows you to sign our XML document.

SignXmlXadesB.java
// Preparing parameters for the XAdES signature
XAdESSignatureParameters parameters = new XAdESSignatureParameters();
// We choose the level of the signature (-B, -T, -LT, -LTA).
parameters.setSignatureLevel(SignatureLevel.XAdES_BASELINE_B);
// We choose the type of the signature packaging (ENVELOPED, ENVELOPING, DETACHED).
parameters.setSignaturePackaging(SignaturePackaging.ENVELOPED);
// We set the digest algorithm to use with the signature algorithm. You must use the
// same parameter when you invoke the method sign on the token. The default value is SHA256
parameters.setDigestAlgorithm(DigestAlgorithm.SHA256);

// We set the signing certificate
parameters.setSigningCertificate(privateKey.getCertificate());
// We set the certificate chain
parameters.setCertificateChain(privateKey.getCertificateChain());

// Create common certificate verifier
CommonCertificateVerifier commonCertificateVerifier = new CommonCertificateVerifier();

// Create XAdES service for signature
XAdESService service = new XAdESService(commonCertificateVerifier);

// Get the SignedInfo XML segment that need to be signed.
ToBeSigned dataToSign = service.getDataToSign(toSignDocument, parameters);

// This function obtains the signature value for signed information using the
// private key and specified algorithm
SignatureValue signatureValue = signingToken.sign(dataToSign, parameters.getDigestAlgorithm(), privateKey);

// We invoke the service to sign the document with the signature value obtained in
// the previous step.
DSSDocument signedDocument = service.signDocument(toSignDocument, parameters, signatureValue);

What you may notice is that to sign a document we need to:

  • Create an object based on SignatureParameters class. The number of specified parameters depends on the type of signature. Generally, the number of specified parameters depends on the profile of signature. This object also defines some default parameters.

  • Choose the profile, packaging, signature digest algorithm.

  • Indicate the private key entry to be used.

  • Instantiate the adequate signature service.

  • Carry out the signature process.

The encryption algorithm is determined by the private key and therefore cannot be compelled by the setter of the signature parameters object. It will cause an inconsistency in the signature making its validation impossible. This setter can be used in a particular context where the signing process is distributed on different machines and the private key is known only to the signature value creation process. See clause "Signing process" for more information. In the case where the private key entry object is not available, it is possible to choose the signing certificate and its certificate chain as in the following example:

// We set the signing certificate
parameters.setSigningCertificate(certificateToken);
// We set the certificate chain
parameters.setCertificateChain(certificateChain);

Integrating the certificate chain in the signature simplifies the build of a prospective certificate chain during the validation process.

By default the framework uses the current date time to set the signing date, but in the case where it is necessary to indicate the different time it is possible to use the setter "setSigningDate(Date)" as in the example:

// We set the date of the signature.
parameters.bLevel().setSigningDate(new Date());

When the specific service is instantiated a certificate verifier must be set. This object is used to provide four different sources of information:

  • the source of trusted certificates (based on the trusted list(s) specific to the context);

  • the source of intermediate certificates used to build the certificate chain till the trust anchor. This source is only needed when these certificates are not included in the signature itself;

  • the source of OCSP;

  • the source of CRL.

In the current implementation this object is only used when profile -LT or -LTA are created.

Signing process

Once the parameters of the signature were identified the service object itself must be created. The service used will depend on the type of document to sign. In our case it is an XML file, so we will instantiate a XAdES service. The process of signing takes place in three stages. The first is the "getDataToSign ()" method call, passing as a parameter the document to be signed and the previously selected settings. This step returns the data which is going to be digested and encrypted. In our case it corresponds to the SignedInfo XMLDSig element.

// Create XAdES service for signature
XAdESService service = new XAdESService(commonCertificateVerifier);

// Get the SignedInfo XML segment that need to be signed.
ToBeSigned dataToSign = service.getDataToSign(toSignDocument, parameters);

The next step is a call to the function "sign()" which is invoked on the object token representing the KeyStore and not on the service. This method takes three parameters. The first is the array of bytes that must be signed. It is obtained by the previous method invocation. The second is the algorithm used to create the digest. You have the choice between SHA1, SHA256, and SHA512 (this list is not exhaustive). And the last one is the private key entry.

DigestAlgorithm digestAlgorithm = parameters.getDigestAlgorithm();
SignatureValue signatureValue = signingToken.sign(dataToSign, digestAlgorithm, privateKey);

The last step of this process is the integration of the signature value in the signature and linking of that one to the signed document based on the selected packaging method. This is the method "signDocument()" on the service. We must pass to it three parameters: again the document to sign, the signature parameters and the value of the signature obtained in the previous step.

This separation into three steps allows use cases where different environments have their precise responsibilities: specifically the distinction between communicating with the token and executing the business logic.

When the breakdown of this process is not necessary than a simple call to only one method can be done as in the following example:

DSSDocument signedDocument = service.signDocument(toSignDocument, parameters, signatureValue);
Additional attributes

For this type (XAdES-BASELINE-B) of signature it is possible to identify some additional attributes:

  • SignerRole - contains claimed or certified roles assumed by the signer when creating the signature.

  • SignatureProductionPlace - contains the indication of the purported place where the signer claims to have produced the signature.

  • CommitmentTypeIndication - identifies the commitment undertaken by the signer in signing (a) signed data object(s) in the context of the selected signature policy.

  • AllDataObjectsTimeStamp - each time-stamp token within this property covers the full set of references defined in the Signature’s SignedInfo element, excluding references of type "SignedProperties".

  • IndividualDataObjectsTimeStamp - each time-stamp token within this property covers selected signed data objects.

The DSS framework allows to setup the following signed properties: SignerRole, SignatureProductionPlace, CommitmentTypeIndication, AllDataObjectsTimestamp and IndividualDataObjectsTimeStamp.

SignXmlXadesBProperties.java
XAdESSignatureParameters parameters = new XAdESSignatureParameters();
parameters.setSignaturePackaging(SignaturePackaging.ENVELOPED);
parameters.setSignatureLevel(SignatureLevel.XAdES_BASELINE_B);
parameters.setDigestAlgorithm(DigestAlgorithm.SHA512);

parameters.setSigningCertificate(privateKey.getCertificate());
parameters.setCertificateChain(privateKey.getCertificateChain());

BLevelParameters bLevelParameters = parameters.bLevel();
bLevelParameters.addClaimedSignerRole("My Claimed Role");

SignerLocation signerLocation = new SignerLocation();
signerLocation.setCountry("BE");
signerLocation.setStateOrProvince("Luxembourg");
signerLocation.setPostalCode("1234");
signerLocation.setLocality("SimCity");
bLevelParameters.setSignerLocation(signerLocation);

List<String> commitmentTypeIndications = new ArrayList<String>();
commitmentTypeIndications.add("http://uri.etsi.org/01903/v1.2.2#ProofOfOrigin");
commitmentTypeIndications.add("http://uri.etsi.org/01903/v1.2.2#ProofOfApproval");
bLevelParameters.setCommitmentTypeIndications(commitmentTypeIndications);

CommonCertificateVerifier verifier = new CommonCertificateVerifier();
XAdESService service = new XAdESService(verifier);
ToBeSigned dataToSign = service.getDataToSign(toSignDocument, parameters);
SignatureValue signatureValue = signingToken.sign(dataToSign, parameters.getDigestAlgorithm(), privateKey);

DSSDocument signedDocument = service.signDocument(toSignDocument, parameters, signatureValue);

This code adds the following elements into the signature :

        <xades:SignerRole>
                <xades:ClaimedRoles>
                        <xades:ClaimedRole>My Claimed Role</xades:ClaimedRole>
                </xades:ClaimedRoles>
        </xades:SignerRole>
        <xades:SignatureProductionPlace>
                <xades:City>SimCity</xades:City>
                <xades:PostalCode>1234</xades:PostalCode>
                <xades:StateOrProvince>Luxembourg</xades:StateOrProvince>
                <xades:CountryName>BE</xades:CountryName>
        </xades:SignatureProductionPlace>
</xades:SignedSignatureProperties>
<xades:SignedDataObjectProperties>
        <xades:DataObjectFormat ObjectReference="#xml_ref_id">
                <xades:MimeType>text/xml</xades:MimeType>
        </xades:DataObjectFormat>
        <xades:CommitmentTypeIndication>
                <xades:CommitmentTypeId>
                        <xades:Identifier>http://uri.etsi.org/01903/v1.2.2#ProofOfOrigin</xades:Identifier>
                        <xades:Identifier>http://uri.etsi.org/01903/v1.2.2#ProofOfApproval</xades:Identifier>
                </xades:CommitmentTypeId>
                <xades:AllSignedDataObjects/>
        </xades:CommitmentTypeIndication>
Handling signature policy

With the new standards the policy handling is linked to -B level. The old -EPES level is not used anymore by the framework. This does not alter the structure of the old signature but only modifies how to control the process of its creation.

The DSS framework allows you to reference a signature policy, which is a set of rules for the creation and validation of an electronic signature. It includes two kinds of text:

  • In human readable form: It can be assessed to meet the requirements of the legal and contractual context in which it is being applied.

  • In a machine processable form: To facilitate its automatic processing using the electronic rules.

If no signature policy is identified then the signature may be assumed to have been generated or verified without any policy constraints, and hence may be given no specific legal or contractual significance through the context of a signature policy.

The signer may reference the policy either implicitly or explicitly. An implied policy means the signer follows the rules of the policy but the signature does not indicate which policy. It is assumed the choice of policy is clear from the context in which the signature is used and SignaturePolicyIdentifier element will be empty. When the policy is not implied, the signature contains an ObjectIdentier that uniquely identifies the version of the policy in use. The signature also contains a hash of the policy document to make sure that the signer and verifier agree on the contents of the policy document.

This example demonstrates an implicit policy identifier. To implement this alternative you must set SignaturePolicyId to empty string.

SignXmlXadesBImplicitPolicyTest.java
XAdESSignatureParameters parameters = new XAdESSignatureParameters();
parameters.setSignatureLevel(SignatureLevel.XAdES_BASELINE_B);
parameters.setSignaturePackaging(SignaturePackaging.ENVELOPED);
parameters.setDigestAlgorithm(DigestAlgorithm.SHA256);

// We set the signing certificate
parameters.setSigningCertificate(privateKey.getCertificate());
// We set the certificate chain
parameters.setCertificateChain(privateKey.getCertificateChain());

BLevelParameters bLevelParameters = parameters.bLevel();

Policy policy = new Policy();
policy.setId("");

bLevelParameters.setSignaturePolicy(policy);

// Create common certificate verifier
CommonCertificateVerifier commonCertificateVerifier = new CommonCertificateVerifier();
// Create xadesService for signature
XAdESService service = new XAdESService(commonCertificateVerifier);

// Get the SignedInfo segment that need to be signed.
ToBeSigned dataToSign = service.getDataToSign(toSignDocument, parameters);

// This function obtains the signature value for signed information using the
// private key and specified algorithm
DigestAlgorithm digestAlgorithm = parameters.getDigestAlgorithm();
SignatureValue signatureValue = signingToken.sign(dataToSign, digestAlgorithm, privateKey);

// We invoke the xadesService to sign the document with the signature value obtained in
// the previous step.
DSSDocument signedDocument = service.signDocument(toSignDocument, parameters, signatureValue);

An XML segment will be added to the signature’s qualified and signed properties:

<xades:SignaturePolicyIdentifier>
        <xades:SignaturePolicyId>
                <xades:SignaturePolicyImplied/>
        </xades:SignaturePolicyId>
</xades:SignaturePolicyIdentifier>

The next example demonstrates an explicit policy identifier. This is obtained by setting -B profile signature policy and assigning values to the policy parameters. The Signature Policy Identifier is a URI or OID that uniquely identifies the version of the policy document. The signature will contain the identifier of the hash algorithm and the hash value of the policy document. The DSS framework does not automatically calculate the hash value; it is to the developer to proceed with the calculation using for example java.security.MessageDigest class (rt.jar). It is important to keep the policy file intact in order to keep the hash constant. It would be wise to make the policy file read-only. See also chapter 7 for further information.

SignXmlXadesBExplicitPolicyTest.java
XAdESSignatureParameters parameters = new XAdESSignatureParameters();
parameters.setSignatureLevel(SignatureLevel.XAdES_BASELINE_B);
parameters.setSignaturePackaging(SignaturePackaging.ENVELOPED);
parameters.setDigestAlgorithm(DigestAlgorithm.SHA256);

// We set the signing certificate
parameters.setSigningCertificate(privateKey.getCertificate());
// We set the certificate chain
parameters.setCertificateChain(privateKey.getCertificateChain());

BLevelParameters bLevelParameters = parameters.bLevel();

// Get and use the explicit policy
String signaturePolicyId = "http://www.example.com/policy.txt";
DigestAlgorithm signaturePolicyHashAlgo = DigestAlgorithm.SHA256;
String signaturePolicyDescription = "Policy text to digest";
byte[] signaturePolicyDescriptionBytes = signaturePolicyDescription.getBytes();
byte[] digestedBytes = DSSUtils.digest(signaturePolicyHashAlgo, signaturePolicyDescriptionBytes);

Policy policy = new Policy();
policy.setId(signaturePolicyId);
policy.setDigestAlgorithm(signaturePolicyHashAlgo);
policy.setDigestValue(digestedBytes);

bLevelParameters.setSignaturePolicy(policy);

// Create common certificate verifier
CommonCertificateVerifier commonCertificateVerifier = new CommonCertificateVerifier();
// Create xadesService for signature
XAdESService service = new XAdESService(commonCertificateVerifier);

// Get the SignedInfo segment that need to be signed.
ToBeSigned dataToSign = service.getDataToSign(toSignDocument, parameters);

// This function obtains the signature value for signed information using the
// private key and specified algorithm
DigestAlgorithm digestAlgorithm = parameters.getDigestAlgorithm();
SignatureValue signatureValue = signingToken.sign(dataToSign, digestAlgorithm, privateKey);

// We invoke the xadesService to sign the document with the signature value obtained in
// the previous step.
DSSDocument signedDocument = service.signDocument(toSignDocument, parameters, signatureValue);

The following XML segment will be added to the signature qualified & signed properties (<QualifyingProperties><SignedProperties>):

<xades:SignaturePolicyIdentifier>
        <xades:SignaturePolicyId>
                <xades:SigPolicyId>
                        <xades:Identifier>http://www.example.com/policy.txt</xades:Identifier>
                </xades:SigPolicyId>
                <xades:SigPolicyHash>
                        <ds:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"/>
                <ds:DigestValue>Uw3PxkrX4SpF03jDvkSu6Zqm9UXDxs56FFXeg7MWy0c=</ds:DigestValue>
                </xades:SigPolicyHash>
        </xades:SignaturePolicyId>
</xades:SignaturePolicyIdentifier>

XAdES-BASELINE-T

XAdES-BASELINE-T is a signature for which there exists a trusted time associated to the signature. It provides the initial steps towards providing long term validity and more specifically it provides a protection against repudiation. This extension of the signature can be created as well during the generation process as validation process. However, the case when these validation data are not added during the generation process should no longer occur. The XAdES-BASELINE-T trusted time indications must be created before the signing certificate has been revoked or expired and close to the time that the XAdES signature was produced. The XAdES-BASELINE-T form must be built on a XAdES-BASELINE-B form. The DSS framework allows extending the old -BES and -EPES profiles to the new BASELINE-T profile, indeed there is no difference in the structure of the signature.

To implement this profile of signature you must indicate to the service the TSA source, which delivers from each Timestamp Request a Timestamp Response (RFC 3161 (cf. [R07])) containing tokens. Below is the source code that creates a XAdES-BASELINE-T signature. For our example we will use a virtual provider. In a real situation, you can use OnlineTSPSource class encompassing communication with Time Stamping Authority based on RFC 3161 (cf. [R07]) or you can implement your own class using TSPSource interface (see "TSP Sources" chapter for more details).

SignXmlXadesTTest.java
// Preparing parameters for the XAdES signature
XAdESSignatureParameters parameters = new XAdESSignatureParameters();
// We choose the level of the signature (-B, -T, -LT, -LTA).
parameters.setSignatureLevel(SignatureLevel.XAdES_BASELINE_T);
// We choose the type of the signature packaging (ENVELOPED, ENVELOPING, DETACHED).
parameters.setSignaturePackaging(SignaturePackaging.ENVELOPED);
// We set the digest algorithm to use with the signature algorithm. You must use the
// same parameter when you invoke the method sign on the token. The default value is SHA256
parameters.setDigestAlgorithm(DigestAlgorithm.SHA256);

// We set the signing certificate
parameters.setSigningCertificate(privateKey.getCertificate());
// We set the certificate chain
parameters.setCertificateChain(privateKey.getCertificateChain());

// Create common certificate verifier
CommonCertificateVerifier commonCertificateVerifier = new CommonCertificateVerifier();
// Create XAdES service for signature
XAdESService service = new XAdESService(commonCertificateVerifier);

// Set the TimeStamp
MockTSPSource mockTSPSource;

try {
        mockTSPSource = new MockTSPSource(new CertificateService().generateTspCertificate(SignatureAlgorithm.RSA_SHA256));
        service.setTspSource(mockTSPSource);
} catch (Exception e) {
        throw new DSSException("Error during MockTspSource", e);
}

// Get the SignedInfo XML segment that need to be signed.
ToBeSigned dataToSign = service.getDataToSign(toSignDocument, parameters);

// This function obtains the signature value for signed information using the
// private key and specified algorithm
SignatureValue signatureValue = signingToken.sign(dataToSign, parameters.getDigestAlgorithm(), privateKey);

// We invoke the service to sign the document with the signature value obtained in
// the previous step.
DSSDocument signedDocument = service.signDocument(toSignDocument, parameters, signatureValue);

The SignatureTimeStamp mandated by the XAdES-T form appears as an unsigned property within the QualifyingProperties:

<SignatureTimeStamp Id="time-stamp-28a441da-4030-46ef-80e1-041b66c0cb96">
        <ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" />
        <EncapsulatedTimeStamp
                Id="time-stamp-token-76234ed8-cc15-46fc-aa95-9460dd601cad">
                        MIAGCSqGSIb3DQEHAqCAMIACAQMxCzAJBgUrDgMCGg
                        UAMIAGCyqGSIb3DQEJEAEEoIAkgARMMEoCAQEGBoIS
                        ...
        </EncapsulatedTimeStamp>
</SignatureTimeStamp>
Use of online TSP source

If you know the address of an online TSP source, so you can make the call as below:

SignXmlXadesTWithOnlineSourceTest.java
// Preparing parameters for the XAdES signature
XAdESSignatureParameters parameters = new XAdESSignatureParameters();
// We choose the level of the signature (-B, -T, -LT, -LTA).
parameters.setSignatureLevel(SignatureLevel.XAdES_BASELINE_T);
// We choose the type of the signature packaging (ENVELOPED, ENVELOPING, DETACHED).
parameters.setSignaturePackaging(SignaturePackaging.ENVELOPED);
// We set the digest algorithm to use with the signature algorithm. You must use the
// same parameter when you invoke the method sign on the token. The default value is SHA256
parameters.setDigestAlgorithm(DigestAlgorithm.SHA256);

// We set the signing certificate
parameters.setSigningCertificate(privateKey.getCertificate());
// We set the certificate chain
parameters.setCertificateChain(privateKey.getCertificateChain());

// Create common certificate verifier
CommonCertificateVerifier commonCertificateVerifier = new CommonCertificateVerifier();
// Create XAdES service for signature
XAdESService service = new XAdESService(commonCertificateVerifier);

// Set the Timestamp source
String tspServer = "http://tsa.belgium.be/connect";
OnlineTSPSource onlineTSPSource = new OnlineTSPSource(tspServer);
service.setTspSource(onlineTSPSource);

// Get the SignedInfo XML segment that need to be signed.
ToBeSigned dataToSign = service.getDataToSign(toSignDocument, parameters);

// This function obtains the signature value for signed information using the
// private key and specified algorithm
SignatureValue signatureValue = signingToken.sign(dataToSign, parameters.getDigestAlgorithm(), privateKey);

// We invoke the service to sign the document with the signature value obtained in
// the previous step.
DSSDocument signedDocument = service.signDocument(toSignDocument, parameters, signatureValue);

If the timestamp source is not set a NullPointerException is thrown.

XAdES-BASELINE-LT

This level has to prove that the certification path was valid, at the time of the validation of the signature, up to a trust point according to the naming constraints and the certificate policy constraints from the "Signature Validation Policy". It will add to the signature the CertificateValues and RevocationValues unsigned properties. The CertificateValues element contains the full set of certificates that have been used to validate the electronic signature, including the signer’s certificate. However, it is not necessary to include one of those certificates, if it is already present in the ds:KeyInfo element of the signature. This is like DSS framework behaves. In order to find a list of all the certificates and the list of all revocation data, an automatic process of signature validation is executed. To carry out this process an object called CertificateVerifier must be passed to the service. The implementer must set some of its properties like par example the source of trusted certificates. The code below shows how to use the default parameters with this object. Please refer to "The Signature Validation" chapter to have the further information. It also includes an example of how to implement this level of signature:

SignXmlXadesLTTest.java
// Preparing parameters for the XAdES signature
XAdESSignatureParameters parameters = new XAdESSignatureParameters();
// We choose the level of the signature (-B, -T, -LT, -LTA).
parameters.setSignatureLevel(SignatureLevel.XAdES_BASELINE_LT);
// We choose the type of the signature packaging (ENVELOPED, ENVELOPING, DETACHED).
parameters.setSignaturePackaging(SignaturePackaging.ENVELOPED);
// We set the digest algorithm to use with the signature algorithm. You must use the
// same parameter when you invoke the method sign on the token. The default value is SHA256
parameters.setDigestAlgorithm(DigestAlgorithm.SHA256);

// We set the signing certificate
parameters.setSigningCertificate(privateKey.getCertificate());
// We set the certificate chain
parameters.setCertificateChain(privateKey.getCertificateChain());

// Create common certificate verifier
CommonCertificateVerifier commonCertificateVerifier = new CommonCertificateVerifier();

CommonsDataLoader commonsHttpDataLoader = new CommonsDataLoader();

KeyStoreCertificateSource keyStoreCertificateSource = new KeyStoreCertificateSource(new File("src/main/resources/keystore.p12"), "PKCS12",
                "dss-password");

TrustedListsCertificateSource tslCertificateSource = new TrustedListsCertificateSource();

TSLRepository tslRepository = new TSLRepository();
tslRepository.setTrustedListsCertificateSource(tslCertificateSource);

TSLValidationJob job = new TSLValidationJob();
job.setDataLoader(commonsHttpDataLoader);
job.setOjContentKeyStore(keyStoreCertificateSource);
job.setLotlRootSchemeInfoUri("https://ec.europa.eu/information_society/policy/esignature/trusted-list/tl.html");
job.setLotlUrl("https://ec.europa.eu/information_society/policy/esignature/trusted-list/tl-mp.xml");
job.setOjUrl("http://eur-lex.europa.eu/legal-content/EN/TXT/?uri=uriserv:OJ.C_.2016.233.01.0001.01.ENG");
job.setLotlCode("EU");
job.setRepository(tslRepository);
job.refresh();

commonCertificateVerifier.setTrustedCertSource(tslCertificateSource);

OnlineCRLSource onlineCRLSource = new OnlineCRLSource();
onlineCRLSource.setDataLoader(commonsHttpDataLoader);
commonCertificateVerifier.setCrlSource(onlineCRLSource);

OnlineOCSPSource onlineOCSPSource = new OnlineOCSPSource();
onlineOCSPSource.setDataLoader(commonsHttpDataLoader);
commonCertificateVerifier.setOcspSource(onlineOCSPSource);

// Create XAdES service for signature
XAdESService service = new XAdESService(commonCertificateVerifier);
try {
        service.setTspSource(getMockTSPSource());
} catch (Exception e) {
        throw new DSSException("Error during MockTspSource", e);
}

// Get the SignedInfo XML segment that need to be signed.
ToBeSigned dataToSign = service.getDataToSign(toSignDocument, parameters);

// This function obtains the signature value for signed information using the
// private key and specified algorithm
SignatureValue signatureValue = signingToken.sign(dataToSign, parameters.getDigestAlgorithm(), privateKey);

// We invoke the service to sign the document with the signature value obtained in
// the previous step.
DSSDocument signedDocument = service.signDocument(toSignDocument, parameters, signatureValue);

The following XML segment will be added to the signature qualified and unsigned properties:

<CertificateValues>
        <EncapsulatedX509Certificate>
                MIIFNTCCBB2gAwIBAgIBATANB...
        </EncapsulatedX509Certificate>
        <EncapsulatedX509Certificate>
                MIIFsjCCBJqgAwIBAgIDAMoBM...
        </EncapsulatedX509Certificate>
        <EncapsulatedX509Certificate>
                MIIFRjCCBC6gAwIBAgIBATANB...
        </EncapsulatedX509Certificate>
</CertificateValues>
<RevocationValues>
        <OCSPValues>
                <EncapsulatedOCSPValue>
                        MIIGzAoBAKCCBsUwggbBBgkr...
                </EncapsulatedOCSPValue>
        </OCSPValues>
</RevocationValues>
Note
The use of online sources can significantly increase the execution time of the signing process. For testing purpose you can create your own source of data.

In last example the CommonsHttpDataLoader is used to provide the communication layer for HTTP protocol. Each source which need to go through the network to retrieve data need to have this component set.

XAdES-BASELINE-LTA

When the cryptographic data becomes weak and the cryptographic functions become vulnerable the auditor should take steps to maintain the validity of the signature. The XAdES-BASELINE-A form uses a simple approach called "archive validation data". It adds additional time-stamps for archiving signatures in a way that they are still protected, but also to be able to prove that the signatures were validated at the time when the used cryptographic algorithms were considered safe. The time-stamping process may be repeated every time the protection used becomes weak. Each time-stamp needs to be affixed before either the signing key or the algorithms used by the TSA are no longer secure. XAdES-A form adds the ArchiveTimestamp element within the UnsignedSignatureProperties and may contain several ArchiveTimestamp elements.

Below is an example of the implementation of this level of signature (but in practice, we will rather extend the signature to this level when there is a risk that the cryptographic functions become vulnerable or when one of certificates arrives to its expiration date):

...
parameters.setSignatureLevel(SignatureLevel.XAdES_BASELINE_LTA);
...

The following XML segment will be added to the signature qualified and unsigned properties:

<ns4:ArchiveTimeStamp
        Id="time-stamp-22b92602-2670-410e-888f-937c5777c685">
        <ds:CanonicalizationMethod
                Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" />
        <EncapsulatedTimeStamp
                Id="time-stamp-token-0bd5aaf3-3850-4911-a22d-c98dcaca5cea">MIAGCSqGSDHAqCAM…
        </EncapsulatedTimeStamp>
</ns4:ArchiveTimeStamp>

Various settings

Trust anchor inclusion policy

It is possible to indicate to the framework if the certificate related to the trust anchor should be included to the signature or not. The setter #setTrustAnchorBPPolicy of the BLevelParameters class should be used for this purpose.

This rule applies as follows: when -B level is constructed the trust anchor is not included, when -LT level is constructed the trust anchor is included.

Note
when trust anchor baseline profile policy is defined only the certificates previous to the trust anchor are included when -B level is constructed.

Multiple signatures

In everyday life, there are many examples where it is necessary to have multiple signatures covering the same document, such as a contract to purchase a vehicle. Independent signatures are parallel signatures where the ordering of the signatures is not important. The computation of these signatures is performed on exactly the same input but using different private keys.

The XML Signature Extension (XAdES)

The -B level contains immutable signed properties. Once this level is created, these properties cannot be changed.

The levels -T/-LT/-LTA add unsigned properties to the signature. This means that the properties of these levels could be added afterwards to any AdES signature. This addition helps to make the signature more resistant to cryptographic attacks on a longer period of time. The extension of the signature is incremental, i.e. when you want to extend the signature to the level -LT the lower level (-T) will also be added. The whole extension process is implemented by reusing components from signature production. To extend a signature we proceed in the same way as in the case of a signature, except that you have to call the function "extendDocument" instead of the "sign" function. Note that when the document is signed with several signatures then they are all extended.

XAdES-BASELINE-T

The XAdES-BASELINE-T trusted time indications have to be created before a certificate has been revoked or expired and close to the time that the XAdES signature was produced. It provides a protection against repudiation. The framework adds the timestamp only if there is no timestamp or there is one but the creation of a new extension of the level-T is deliberate (using another TSA). It is not possible to extend a signature which already incorporates higher level as -LT or -LTA. In the theory it would be possible to add another -T level when the signature has already reached level -LT but the framework prevents this operation. Note that if the signed document contains multiple signatures, then all the signatures will be extended to level -T. It is also possible to sign a document directly at level -T.

Here is an example of creating an extension of type T:

ExtendSignXmlXadesBToTTest.java
DSSDocument document = new FileDocument("src/test/resources/signedXmlXadesB.xml");

XAdESSignatureParameters parameters = new XAdESSignatureParameters();
parameters.setSignatureLevel(SignatureLevel.XAdES_BASELINE_T);

CommonCertificateVerifier certificateVerifier = new CommonCertificateVerifier();
XAdESService xadesService = new XAdESService(certificateVerifier);
xadesService.setTspSource(getMockTSPSource());

DSSDocument extendedDocument = xadesService.extendDocument(document, parameters);

Here is the result of adding a new extension of type-T to an already existing -T level signature:

<UnsignedSignatureProperties>
        <SignatureTimeStamp Id="time-stamp-b16a2552-b218-4231-8982-40057525fbb5">
                <ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" />
                <EncapsulatedTimeStamp Id="time-stamp-token-39fbf78c-9cec-4cc1-ac21-a467d2238405">                         MIAGCSqGSIb3DQEHAq...
                </EncapsulatedTimeStamp>
        </SignatureTimeStamp>
        <SignatureTimeStamp Id="time-stamp-5ffab0d9-863b-414a-9690-a311d3e1af1d">
                <ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" />
                <EncapsulatedTimeStamp Id="time-stamp-token-87e8c599-89e5-4fb3-a32a-e5e2a40073ad">                         MIAGCSqGSIb3DQEHAq...
                </EncapsulatedTimeStamp>
        </SignatureTimeStamp>
</UnsignedSignatureProperties>

XAdES-BASELINE-LT and -LTA

For these types of extensions, the procedure to follow is the same as the case of the extension of type T. Please refer to the chapter XAdES Profiles (XAdES) to know specific parameters for each level of signature and which must be positioned.

XAdES and specific schema version

Some signatures may have been created with an older version of XAdES standard using different schema definition. To take into account the validation of such signatures the class eu.europa.esig.dss.xades.validation.XPathQueryHolder was created. This class includes all XPath queries which are used to explore the elements of the signature. It is now easy to extend this class in order to define specific queries to a given schema. The DSS framework proposes in standard the class eu.europa.esig.dss.xades.validation.XAdES111XPathQueryHolder that defines the XPath queries for the version "http://uri.etsi.org/01903/v1.1.1#" of XAdES standard.

When carrying out the validation process of the signature, the choice of query holder to be used is taken by invoking the method: eu.europa.esig.dss.xades.validation.XPathQueryHolder#canUseThisXPathQueryHolder

This choice is made based on the namespace. If the namespace is: http://uri.etsi.org/01903/v1.3.2# then the default query holder is used, if the namespace is http://uri.etsi.org/01903/v1.1.1# the XAdES111XPathQueryHolder is used. The element used to choose the namespace is "QualifyingProperties".

To implement another query holder the class XPathQueryHolder must be extended, new XPath queries defined and the method canUseThisXPathQueryHolder overridden.

In case there is a need to use only a specific query holder the following steps should be followed:

  • Call: eu.europa.esig.dss.xades.validation.XMLDocumentValidator#clearQueryHolders

  • Call: eu.europa.esig.dss.xades.validation.XMLDocumentValidator#addXPathQueryHolder and pass the specific query holder

The signature validation

Generally and following ETSI standard, the validation process of an electronic signature must provide one of the three following status: TOTAL-FAILED, TOTAL-PASSED or INDETERMINATE. A TOTAL-PASSED response indicates that the signature has passed verification and it complies with the signature validation policy. An TOTAL_FAILED response indicates that either the signature format is incorrect or that the digital signature value fails verification. An INDETERMINATE validation response indicates that the format and digital signature verifications have not failed but there is insufficient information to determine if the electronic signature is valid. For each of the validation checks, the validation process must provide information justifying the reasons for the resulting status indication as a result of the check against the applicable constraints. In addition, the ETSI standard defines a consistent and accurate way for justifying statuses under a set of sub-indications.

Validation Process

Since version 4.7 of the DSS framework the validation process is based on the latest ETSI standard [R08]. It is driven by the validation policy and allows long term signature validation. It not only verifies the existence of certain data and their validity, but it also checks the temporal dependences between these elements. The signature check is done following basic building blocks. On the simplified diagram below, showing the process of the signature validation, you can follow the relationships between each building block which represents a logic set of checks used in validation process.

sig validation process

Note that the current version of the framework during the validation process does not indicate what part of document was signed. However, in the case of the XAdES signature XPath transformations present in the signature will be applied, in the case of CAdES or PAdES signature the whole document must be signed.

At the end of the validation process three reports are created. They contain the different details level concerning the validation result. They provide three kinds of visions of validation process: macroscopic, microscopic and input data. For more information about these reports, please refer to "Simple Report" chapter.

Below is the simplest example of the validation of the signature of a document. The first thing to do is instantiating an object named validator, which orchestrates the verification of the different rules. To perform this it is necessary to invoke a static method fromDocument() on the abstract class SignedDocumentValidator. This method returns the object in question whose type is chosen dynamically based on the type of source document. The DSS framework provides four types of validators:

  • XMLDocumentValidator,

  • CMSDocumentValidator,

  • PDFDocumentValidator,

  • ASiCContainerWithXAdESValidator,

  • ASiCContainerWithCAdESValidator.

The next step is to create an object that will check the status of a certificate using the Trusted List model (see "Trusted Lists of Certification Service Provider" for more information). In our example, this object is instantiated from the TrustedListCertificateVerifier class. In turn, this object needs an OCSP and/or CRL source and a TSL source (which defines how the certificates are retrieved from the Trusted Lists). See chapter "Management of CRL and OCSP Sources" for more information concerning sources.

Note this validation process uses the default validation policy which can be changed by each implementer. To see how to use a customised validation policy, please refer to "5.4" More information can be found on joinup: https://joinup.ec.europa.eu/asset/sd-dss/topic/how-validate-signature-real-crl-ocsp-and-certificate-sources#comment-15459

ValidateSignedXmlXadesBTest.java
// To be able to validate our fake signature, we must define one of the certificates in the chain as trusted
// anchor.
// If you have a real signature for which it is possible to build the chain till the TSL then just skip this
// point.
preparePKCS12TokenAndKey();
final CertificateToken[] certificateChain = privateKey.getCertificateChain();
final CertificateToken trustedCertificate = certificateChain[0];

// Already signed document - Created with the SignXmlXadesB Class
DSSDocument document = new FileDocument(new File("src/test/resources/signedXmlXadesB.xml"));
SignedDocumentValidator validator = SignedDocumentValidator.fromDocument(document);

CommonCertificateVerifier verifier = new CommonCertificateVerifier();
AlwaysValidOCSPSource ocspSource = new AlwaysValidOCSPSource();
verifier.setOcspSource(ocspSource);

/**
 * This Trusted List Certificates Source points to
 * "https://ec.europa.eu/information_society/policy/esignature/trusted-list/tl-mp.xml"
 */
MockTSLCertificateSource trustedCertSource = new MockTSLCertificateSource();
ServiceInfo mockServiceInfo = new MockServiceInfo();
trustedCertSource.addCertificate(trustedCertificate, mockServiceInfo);
verifier.setTrustedCertSource(trustedCertSource);

validator.setCertificateVerifier(verifier);

Reports reports = validator.validateDocument();
SimpleReport simpleReport = reports.getSimpleReport();

It is also possible to use the real sources of OSCP, CRL and certificates:

ValidateXmlXadesLTWithOnlineSourcesTest.java
// To be able to validate our fake signature, we must define one of the certificates in the chain as trusted
// anchor.
// If you have a real signature for which it is possible to build the chain till the TSL then just skip this
// point.
preparePKCS12TokenAndKey();
final CertificateToken[] certificateChain = privateKey.getCertificateChain();
final CertificateToken trustedCertificate = certificateChain[0];

// Already signed document
DSSDocument document = new FileDocument(new File("src/test/resources/signedXmlXadesLT.xml"));

SignedDocumentValidator validator = SignedDocumentValidator.fromDocument(document);

CommonsDataLoader commonsDataLoader = new CommonsDataLoader();

CommonCertificateVerifier verifier = new CommonCertificateVerifier();
OnlineCRLSource crlSource = new OnlineCRLSource();
crlSource.setDataLoader(commonsDataLoader);
verifier.setCrlSource(crlSource);

OnlineOCSPSource ocspSource = new OnlineOCSPSource();
// The default OCSPDataLoader is created. You can also create your own HttpDataLoader.
verifier.setOcspSource(ocspSource);

// SEE NOTE 1
FileCacheDataLoader fileCacheDataLoader = new FileCacheDataLoader();
File cacheFolder = new File("/temp");
fileCacheDataLoader.setFileCacheDirectory(cacheFolder);

KeyStoreCertificateSource keyStoreCertificateSource = new KeyStoreCertificateSource(new File("src/main/resources/keystore.p12"), "PKCS12",
                "dss-password");

TrustedListsCertificateSource certificateSource = new TrustedListsCertificateSource();

TSLRepository tslRepository = new TSLRepository();
tslRepository.setTrustedListsCertificateSource(certificateSource);

TSLValidationJob job = new TSLValidationJob();
job.setDataLoader(new CommonsDataLoader());
job.setOjContentKeyStore(keyStoreCertificateSource);
job.setLotlRootSchemeInfoUri("https://ec.europa.eu/information_society/policy/esignature/trusted-list/tl.html");
job.setLotlUrl("https://ec.europa.eu/information_society/policy/esignature/trusted-list/tl-mp.xml");
job.setOjUrl("http://eur-lex.europa.eu/legal-content/EN/TXT/?uri=uriserv:OJ.C_.2016.233.01.0001.01.ENG");
job.setLotlCode("EU");
job.setRepository(tslRepository);

job.refresh();

certificateSource.addCertificate(trustedCertificate, new MockServiceInfo());
verifier.setTrustedCertSource(certificateSource);

verifier.setDataLoader(fileCacheDataLoader);

validator.setCertificateVerifier(verifier);

Reports reports = validator.validateDocument();
SimpleReport simpleReport = reports.getSimpleReport();
DetailedReport detailedReport = reports.getDetailedReport();
Note
When using the TrustedListsCertificateSource class, for performance reasons, consider creating a single instance of this class and initialize it only once.
Note
In general, the signature must cover the entire document so that the DSS framework can validate it. However, for example in the case of a XAdES signature, some transformations can be applied on the XML document. They can include operations such as canonicalization, encoding/decoding, XSLT, XPath, XML schema validation, or XInclude. XPath transforms permit the signer to derive an XML document that omits portions of the source document. Consequently those excluded portions can change without affecting signature validity. Note that the current version of the framework can sign only the entire document.

EU Trusted Lists of Certification Service Providers

On 16 October 2009 the European Commission adopted a Decision setting out measures facilitating the use of procedures by electronic means through the "points of single contact" under the Services Directive. One of the measures adopted by the Decision consisted in the obligation for Member States to establish and publish by 28.12.2009 their Trusted List of supervised/accredited certification service providers issuing qualified certificates to the public. The objective of this obligation is to enhance cross-border use of electronic signatures by increasing trust in electronic signatures originating from other Member States. The Decision was updated several times since 16.10.2009; the last amendment was made on 01.02.2014. The consolidated version is available here for information.

In order to allow access to the trusted lists of all Member States in an easy manner, the European Commission has published a central list with links to national "trusted lists". This central list will now be designated in the document under the abbreviation LOTL.

The LOTL is published by the EU at the following URL : https://ec.europa.eu/information_society/policy/esignature/trusted-list/tl-mp.xml. This XML file contains the list of the trusted list. This file must be signed by an allowed certificate. To know who has the permission to sign / publish the LOTL, we need to refer to the Official Journal Of the Union (http://eur-lex.europa.eu/legal-content/EN/TXT/?uri=uriserv:OJ.C_.2015.435.01.0001.01.ENG).

The signature format of the LOTL and TL should be XAdES-BASELINE-B. If the LOTL signature is valid, its content can be trusted. The LOTL contains for each country some informations : urls of the XML/PDF files, the allowed certificates to sign, …​

So, we trusted the LOTL, we can process each trusted list. If they are valid, we can trust the service providers and its certificates.

To build the source of trust, DSS requires :

  • the LOTL url (XML);

  • the LOTL country code;

  • a trust store which contains allowed certificates (extracted from the OJ).

Bellow, you can find a complete example to load the LOTL and its linked TL.

LOTLLoadingTest.java
// The keystore contains certificates extracted from the OJ
KeyStoreCertificateSource keyStoreCertificateSource = new KeyStoreCertificateSource(new File("src/main/resources/keystore.p12"), "PKCS12",
                "dss-password");

TrustedListsCertificateSource certificateSource = new TrustedListsCertificateSource();

TSLRepository tslRepository = new TSLRepository();
tslRepository.setTrustedListsCertificateSource(certificateSource);

TSLValidationJob job = new TSLValidationJob();
job.setDataLoader(new CommonsDataLoader());
job.setOjContentKeyStore(keyStoreCertificateSource);
job.setLotlRootSchemeInfoUri("https://ec.europa.eu/information_society/policy/esignature/trusted-list/tl.html");
job.setLotlUrl("https://ec.europa.eu/information_society/policy/esignature/trusted-list/tl-mp.xml");
job.setOjUrl("http://eur-lex.europa.eu/legal-content/EN/TXT/?uri=uriserv:OJ.C_.2016.233.01.0001.01.ENG");
job.setLotlCode("EU");
job.setRepository(tslRepository);

job.refresh();

The TrustedListsCertificateSource is updated with the trusted certificates.

To generate the trust store, there’s an utility class CreateKeyStoreApp in the dss-cookbook module.

Validation Result Materials

The result of the validation process consists of three elements:

  • the simple report,

  • the detailed report and,

  • the diagnostic data.

All these reports are encoded using XML, which allows the implementer to easily manipulate and extract information for further analysis. You will find below a detailed description of each of these elements.

Simple Report

This is a sample of the simple validation report.

Simple Report
<SimpleReport xmlns="http://dss.esig.europa.eu/validation/simple-report">
    <Policy>
        <PolicyName>QES AdESQC TL based</PolicyName>
        <PolicyDescription>Validate electronic signatures...</PolicyDescription>
    </Policy>
    <ValidationTime>2016-05-09T10:55:02</ValidationTime>
    <DocumentName>PAdES_B_PVDB.pdf</DocumentName>
    <ValidSignaturesCount>1</ValidSignaturesCount>
    <SignaturesCount>1</SignaturesCount>
    <Signature Id="id-30b3acd8c4fe0ced13b26ed2e6574d91e2e77b19e06a42b6c513a0b046b4561b" SignatureFormat="PAdES_BASELINE_B">
        <SigningTime>2015-07-30T13:49:14</SigningTime>
        <SignedBy>Pierrick Vandenbroucke (Signature)</SignedBy>
        <Indication>TOTAL_PASSED</Indication>
        <SignatureLevel>AdESqc</SignatureLevel>
        <Warnings>The certificate is not supported by SSCD!</Warnings>
        <Infos>The certificate is not issued to a legal person.</Infos>
        <SignatureScope name="Full PDF" scope="FullSignatureScope">Full document</SignatureScope>
    </Signature>
</SimpleReport>

The result of the validation process is based on very complex rules. The purpose of this report is to make as simple as possible the information while keeping the most important elements. Thus the end user can, at a glance, have a synthetic view of the validation. To build this report the framework uses some simple rules and the detailed report as input.

Detailed Report

This is a sample of the detailed validation report. Its structure is based on the ETSI standard [R08] and is built around Basic Building Blocks, Basic Validation Data, Timestamp Validation Data, AdES-T Validation Data and Long Term Validation Data. Some segments were deleted to make reading easier. They are marked by three dots:

Detailed Report
<DetailedReport xmlns="http://dss.esig.europa.eu/validation/detailed-report">
    <Signatures Id="id-30b3acd8c4fe0ced13b26ed2e6574d91e2e77b19e06a42b6c513a0b046b4561b">
        <ValidationProcessBasicSignatures>
            <Constraint Id="id-30b3acd8c4fe0ced13b26ed2e6574d91e2e77b19e06a42b6c513a0b046b4561b">
                <Name NameId="ADEST_ROBVPIIC">Is the result of the Basic Validation Process conclusive?</Name>
                <Status>OK</Status>
            </Constraint>
            <Conclusion>
                <Indication>PASSED</Indication>
            </Conclusion>
        </ValidationProcessBasicSignatures>
        <ValidationProcessLongTermData>
            <Constraint>
                <Name NameId="LTV_ABSV">Is the result of the Basic Validation Process acceptable?</Name>
                <Status>OK</Status>
            </Constraint>
                   ...
            <Conclusion>
                <Indication>PASSED</Indication>
            </Conclusion>
        </ValidationProcessLongTermData>
        <ValidationProcessArchivalData>
            <Constraint>
                <Name NameId="ARCH_LTVV">Is the result of the LTV validation process acceptable?</Name>
                <Status>OK</Status>
            </Constraint>
            <Conclusion>
                <Indication>PASSED</Indication>
            </Conclusion>
        </ValidationProcessArchivalData>
    </Signatures>
    <BasicBuildingBlocks Id="B033DE5A4F6980014D4A51D7C4248C410AAEA11A95B2E731FD277DBC69516D62" Type="REVOCATION">
        <ISC>
            <Constraint>
                <Name NameId="BBB_ICS_ISCI">Is there an identified candidate for the signing certificate?</Name>
                <Status>OK</Status>
            </Constraint>
            <Conclusion>
                <Indication>PASSED</Indication>
            </Conclusion>
        </ISC>
        <CV>
            ...
            <Conclusion>
                <Indication>PASSED</Indication>
            </Conclusion>
        </CV>
        <SAV>
            <Constraint>
                <Name NameId="ASCCM">Are signature cryptographic constraints met?</Name>
                <Status>OK</Status>
            </Constraint>
            <Conclusion>
                <Indication>PASSED</Indication>
            </Conclusion>
        </SAV>
        <XCV>
            ...
            <Conclusion>
                <Indication>PASSED</Indication>
            </Conclusion>
        </XCV>
        <Conclusion>
            <Indication>PASSED</Indication>
        </Conclusion>
    </BasicBuildingBlocks>
    <BasicBuildingBlocks Id="id-30b3acd8c4fe0ced13b26ed2e6574d91e2e77b19e06a42b6c513a0b046b4561b" Type="SIGNATURE">
        <FC>
            ...
            <Conclusion>
                <Indication>PASSED</Indication>
            </Conclusion>
        </FC>
        <ISC>
            ...
            <Conclusion>
                <Indication>PASSED</Indication>
            </Conclusion>
        </ISC>
        <VCI>
            ...
            <Conclusion>
                <Indication>PASSED</Indication>
            </Conclusion>
        </VCI>
        <CV>
            ...
            <Conclusion>
                <Indication>PASSED</Indication>
            </Conclusion>
        </CV>
        <SAV>
            ...
            <Conclusion>
                <Indication>PASSED</Indication>
            </Conclusion>
        </SAV>
        <XCV>
            ...
            <Conclusion>
                <Indication>PASSED</Indication>
            </Conclusion>
        </XCV>
        <Conclusion>
            <Indication>PASSED</Indication>
        </Conclusion>
    </BasicBuildingBlocks>
    <BasicBuildingBlocks Id="DEBA6AAEB488203F71BF3EFC5BCD9F120A9BA500C011010A94911D1224C8FC15" Type="REVOCATION">
        <ISC>
            ...
            <Conclusion>
                <Indication>PASSED</Indication>
            </Conclusion>
        </ISC>
        <CV>
            ...
            <Conclusion>
                <Indication>PASSED</Indication>
            </Conclusion>
        </CV>
        <SAV>
            ...
            <Conclusion>
                <Indication>PASSED</Indication>
            </Conclusion>
        </SAV>
        <XCV>
            ...
            <Conclusion>
                <Indication>PASSED</Indication>
            </Conclusion>
        </XCV>
        <Conclusion>
            <Indication>PASSED</Indication>
        </Conclusion>
    </BasicBuildingBlocks>
</DetailedReport>

For example the Basic Building Blocks are divided into seven elements:

  • FC - Format Checking

  • ISC - Identification of the Signing Certificate

  • VCI - Validation Context Initialization

  • RFC - Revocation Freshness Checker

  • XCV - X.509 certificate validation

  • CV - Cryptographic Verification

  • SAV - Signature Acceptance Validation

The following additional elements also can be execute in case of validation in the past :

  • PCV - Past Certificate Validation

  • VTS - Validation Time Sliding process

  • POE extraction - Proof Of Existence extraction

  • PSV - Past Signature Validation

Each block contains a number of rules that are executed sequentially. The rules are driven by the constraints defined in the validation policy. The result of each rule is OK or NOT OK. The process is stopped when the first rule fails. Each block also contains a conclusion. If all rules are met then the conclusion node indicates PASSED. Otherwise FAILED or INDETERMINATE indication is returned depending on the ETSI standard definition.

Diagnostic Data

This is a data set constructed from the information contained in the signature itself, but also from information retrieved dynamically as revocation data and information extrapolated as the mathematical validity of a signature. All this information is independent of the applied validation policy. Two different validation policies applied to the same diagnostic data can lead to different results.

This is an example of the diagnostic data for a XAdES signature. Certain fields and certain values were trimmed or deleted to make reading easier:

Diagnostic Data
<DiagnosticData xmlns="http://dss.esig.europa.eu/validation/diagnostic">
    <DocumentName>PAdES_B_PVDB.pdf</DocumentName>
    <Signature Id="id-30b3acd8c4fe0ced13b26ed2e6574d91e2e77b19e06a42b6c513a0b046b4561b">
        <DateTime>2015-07-30T13:49:14</DateTime>
        <SignatureFormat>PAdES_BASELINE_B</SignatureFormat>
        <BasicSignature>
            <EncryptionAlgoUsedToSignThisToken>RSA</EncryptionAlgoUsedToSignThisToken>
            <KeyLengthUsedToSignThisToken>1024</KeyLengthUsedToSignThisToken>
            <DigestAlgoUsedToSignThisToken>SHA256</DigestAlgoUsedToSignThisToken>
            <ReferenceDataFound>true</ReferenceDataFound>
            <ReferenceDataIntact>true</ReferenceDataIntact>
            <SignatureIntact>true</SignatureIntact>
            <SignatureValid>true</SignatureValid>
        </BasicSignature>
        <SigningCertificate Id="4199E98D0E5B02935EB72DC8B7F9188E27DDF8A1DCB7BC8C3C3F3C7C1C099D5B">
            <AttributePresent>true</AttributePresent>
            <DigestValuePresent>true</DigestValuePresent>
            <DigestValueMatch>true</DigestValueMatch>
            <IssuerSerialMatch>true</IssuerSerialMatch>
        </SigningCertificate>
        <CertificateChain>
            <ChainCertificate Id="4199E98D0E5B02935EB72DC8B7F9188E27DDF8A1DCB7BC8C3C3F3C7C1C099D5B">
                <Source>SIGNATURE</Source>
            </ChainCertificate>
            <ChainCertificate Id="5A304EA217132A215EF6769CC2933E867377EBDD62815B8FB930F6151ECC6DD3">
                <Source>SIGNATURE</Source>
            </ChainCertificate>
            <ChainCertificate Id="9F9744463BE13714754E1A3BECF98C08CC205E4AB32028F4E2830C4A1B2775B8">
                <Source>TRUSTED_LIST</Source>
            </ChainCertificate>
        </CertificateChain>
        <ContentType>application/pdf</ContentType>
        <SignatureScopes>
            <SignatureScope name="Full PDF" scope="FullSignatureScope">Full document</SignatureScope>
        </SignatureScopes>
    </Signature>
    <UsedCertificates>
        <Certificate Id="5A304EA217132A215EF6769CC2933E867377EBDD62815B8FB930F6151ECC6DD3">
            <SubjectDistinguishedName Format="CANONICAL">2.5.4.5=#1306323031313036,cn=citizen ca,c=be</SubjectDistinguishedName>
            <SubjectDistinguishedName Format="RFC2253">2.5.4.5=#1306323031313036,CN=Citizen CA,C=BE</SubjectDistinguishedName>
            <IssuerDistinguishedName Format="CANONICAL">cn=belgium root ca2,c=be</IssuerDistinguishedName>
            <IssuerDistinguishedName Format="RFC2253">CN=Belgium Root CA2,C=BE</IssuerDistinguishedName>
            <SerialNumber>62628443217889061938893850155211508130</SerialNumber>
            <CommonName>Citizen CA</CommonName>
            <CountryName>BE</CountryName>
            <DigestAlgAndValue>
                <DigestMethod>SHA1</DigestMethod>
                <DigestValue>dMxuVVn/18LdBSbAwhWTxWyThPM=</DigestValue>
            </DigestAlgAndValue>
            <NotAfter>2017-07-16T13:00:00</NotAfter>
            <NotBefore>2010-11-16T12:00:00</NotBefore>
            <PublicKeySize>2048</PublicKeySize>
            <PublicKeyEncryptionAlgo>RSA</PublicKeyEncryptionAlgo>
            <KeyUsageBits>
                <KeyUsage>keyCertSign</KeyUsage>
                <KeyUsage>crlSign</KeyUsage>
            </KeyUsageBits>
            <BasicSignature>
                <EncryptionAlgoUsedToSignThisToken>RSA</EncryptionAlgoUsedToSignThisToken>
                <KeyLengthUsedToSignThisToken>2048</KeyLengthUsedToSignThisToken>
                <DigestAlgoUsedToSignThisToken>SHA1</DigestAlgoUsedToSignThisToken>
                <ReferenceDataFound>true</ReferenceDataFound>
                <ReferenceDataIntact>true</ReferenceDataIntact>
                <SignatureIntact>true</SignatureIntact>
                <SignatureValid>true</SignatureValid>
            </BasicSignature>
            ...
        </Certificate>
        <Certificate Id="7C37121A7E63DCE1F808523CC3A70AF9428A5C973FFAF773E615A526C9E363A7">
            <SubjectDistinguishedName Format="CANONICAL">c=be,cn=belgium ocsp responder</SubjectDistinguishedName>
            <SubjectDistinguishedName Format="RFC2253">C=BE,CN=Belgium OCSP Responder</SubjectDistinguishedName>
            <IssuerDistinguishedName Format="CANONICAL">2.5.4.5=#1306323031313036,cn=citizen ca,c=be</IssuerDistinguishedName>
            <IssuerDistinguishedName Format="RFC2253">2.5.4.5=#1306323031313036,CN=Citizen CA,C=BE</IssuerDistinguishedName>
            <SerialNumber>4835703278459965209480678</SerialNumber>
            <CommonName>Belgium OCSP Responder</CommonName>
            <CountryName>BE</CountryName>
            <DigestAlgAndValue>
                <DigestMethod>SHA1</DigestMethod>
                <DigestValue>ywdlEr+sSR+BKDStlAOj2bdcwcE=</DigestValue>
            </DigestAlgAndValue>
            <NotAfter>2017-01-29T12:00:00</NotAfter>
            <NotBefore>2015-12-08T12:00:00</NotBefore>
            <PublicKeySize>2048</PublicKeySize>
            <PublicKeyEncryptionAlgo>RSA</PublicKeyEncryptionAlgo>
            <KeyUsageBits>
                <KeyUsage>digitalSignature</KeyUsage>
            </KeyUsageBits>
            <IdKpOCSPSigning>true</IdKpOCSPSigning>
            <IdPkixOcspNoCheck>true</IdPkixOcspNoCheck>
            <BasicSignature>
                <EncryptionAlgoUsedToSignThisToken>RSA</EncryptionAlgoUsedToSignThisToken>
                <KeyLengthUsedToSignThisToken>2048</KeyLengthUsedToSignThisToken>
                <DigestAlgoUsedToSignThisToken>SHA1</DigestAlgoUsedToSignThisToken>
                <ReferenceDataFound>true</ReferenceDataFound>
                <ReferenceDataIntact>true</ReferenceDataIntact>
                <SignatureIntact>true</SignatureIntact>
                <SignatureValid>true</SignatureValid>
            </BasicSignature>
            ...
        </Certificate>
        <Certificate Id="9F9744463BE13714754E1A3BECF98C08CC205E4AB32028F4E2830C4A1B2775B8">
            <SubjectDistinguishedName Format="CANONICAL">cn=belgium root ca2,c=be</SubjectDistinguishedName>
            <SubjectDistinguishedName Format="RFC2253">CN=Belgium Root CA2,C=BE</SubjectDistinguishedName>
            <IssuerDistinguishedName Format="CANONICAL">cn=belgium root ca2,c=be</IssuerDistinguishedName>
            <IssuerDistinguishedName Format="RFC2253">CN=Belgium Root CA2,C=BE</IssuerDistinguishedName>
            <SerialNumber>3098404661496965511</SerialNumber>
            <CommonName>Belgium Root CA2</CommonName>
            <CountryName>BE</CountryName>
            <DigestAlgAndValue>
                <DigestMethod>SHA1</DigestMethod>
                <DigestValue>UcygcQr3cz00rNwZRQmfQ1x/xZ8=</DigestValue>
            </DigestAlgAndValue>
            <NotAfter>2021-12-15T09:00:00</NotAfter>
            <NotBefore>2007-10-04T12:00:00</NotBefore>
            <PublicKeySize>2048</PublicKeySize>
            <PublicKeyEncryptionAlgo>RSA</PublicKeyEncryptionAlgo>
            <KeyUsageBits>
                <KeyUsage>keyCertSign</KeyUsage>
                <KeyUsage>crlSign</KeyUsage>
            </KeyUsageBits>
            <BasicSignature>
                <EncryptionAlgoUsedToSignThisToken>RSA</EncryptionAlgoUsedToSignThisToken>
                <KeyLengthUsedToSignThisToken>2048</KeyLengthUsedToSignThisToken>
                <DigestAlgoUsedToSignThisToken>SHA1</DigestAlgoUsedToSignThisToken>
                <ReferenceDataFound>true</ReferenceDataFound>
                <ReferenceDataIntact>true</ReferenceDataIntact>
                <SignatureIntact>true</SignatureIntact>
                <SignatureValid>true</SignatureValid>
            </BasicSignature>
            ...
        </Certificate>
        <Certificate Id="4199E98D0E5B02935EB72DC8B7F9188E27DDF8A1DCB7BC8C3C3F3C7C1C099D5B">
            <SubjectDistinguishedName Format="CANONICAL">2.5.4.5=#130b3837303132373330373338,2.5.4.42=#130d506965727269636b205061636f,2.5.4.4=#130d56616e64656e62726f75636b65,cn=pierrick vandenbroucke (signature),c=be</SubjectDistinguishedName>
            <SubjectDistinguishedName Format="RFC2253">2.5.4.5=#130b3837303132373330373338,2.5.4.42=#130d506965727269636b205061636f,2.5.4.4=#130d56616e64656e62726f75636b65,CN=Pierrick Vandenbroucke (Signature),C=BE</SubjectDistinguishedName>
            <IssuerDistinguishedName Format="CANONICAL">2.5.4.5=#1306323031313036,cn=citizen ca,c=be</IssuerDistinguishedName>
            <IssuerDistinguishedName Format="RFC2253">2.5.4.5=#1306323031313036,CN=Citizen CA,C=BE</IssuerDistinguishedName>
            <SerialNumber>21267647932559036731803747676885855837</SerialNumber>
            <CommonName>Pierrick Vandenbroucke (Signature)</CommonName>
            <CountryName>BE</CountryName>
            <GivenName>Pierrick Paco</GivenName>
            <Surname>Vandenbroucke</Surname>
            <DigestAlgAndValue>
                <DigestMethod>SHA1</DigestMethod>
                <DigestValue>42by2G4VKm3tcQ6c6F5XvOMsSLk=</DigestValue>
            </DigestAlgAndValue>
            <NotAfter>2017-02-18T00:59:59</NotAfter>
            <NotBefore>2012-02-23T09:24:09</NotBefore>
            <PublicKeySize>1024</PublicKeySize>
            <PublicKeyEncryptionAlgo>RSA</PublicKeyEncryptionAlgo>
            <KeyUsageBits>
                <KeyUsage>nonRepudiation</KeyUsage>
            </KeyUsageBits>
            <BasicSignature>
                <EncryptionAlgoUsedToSignThisToken>RSA</EncryptionAlgoUsedToSignThisToken>
                <KeyLengthUsedToSignThisToken>2048</KeyLengthUsedToSignThisToken>
                <DigestAlgoUsedToSignThisToken>SHA1</DigestAlgoUsedToSignThisToken>
                <ReferenceDataFound>true</ReferenceDataFound>
                <ReferenceDataIntact>true</ReferenceDataIntact>
                <SignatureIntact>true</SignatureIntact>
                <SignatureValid>true</SignatureValid>
            </BasicSignature>
           ...
        </Certificate>
    </UsedCertificates>
</DiagnosticData>

Customised Validation Policy

The validation process may be driven by a set of constraints that are contained in the XML file constraint.xml.

constraint.xml (default policy is provided in validation-policy module)
<ConstraintsParameters Name="QES AdESQC TL based" xmlns="http://dss.esig.europa.eu/validation/policy">
        <Description>Validate electronic signatures and indicates whether they are Advanced electronic Signatures (AdES), AdES supported by a Qualified Certificate (AdES/QC) or a
                Qualified electronic Signature (QES). All certificates and their related chains supporting the signatures are validated against the EU Member State Trusted Lists (this includes
                signer's certificate and certificates used to validate certificate validity status services - CRLs, OCSP, and time-stamps).
        </Description>
        <ContainerConstraints>
                <AcceptableContainerTypes Level="FAIL">
                        <Id>ASiC-S</Id>
                        <Id>ASiC-E</Id>
                </AcceptableContainerTypes>
<!--                 <ZipCommentPresent Level="WARN" /> -->
<!--                 <AcceptableZipComment Level="WARN"> -->
<!--                         <Id>mimetype=application/vnd.etsi.asic-s+zip</Id> -->
<!--                         <Id>mimetype=application/vnd.etsi.asic-e+zip</Id> -->
<!--                 </AcceptableZipComment> -->
                <MimeTypeFilePresent Level="FAIL" />
                <AcceptableMimeTypeFileContent Level="WARN">
                        <Id>application/vnd.etsi.asic-s+zip</Id>
                        <Id>application/vnd.etsi.asic-e+zip</Id>
                </AcceptableMimeTypeFileContent>
                <ManifestFilePresent Level="FAIL" />
                <AllFilesSigned Level="WARN" />
        </ContainerConstraints>
        <SignatureConstraints>
                <AcceptablePolicies Level="FAIL">
                        <Id>ANY_POLICY</Id>
                        <Id>NO_POLICY</Id>
                </AcceptablePolicies>
                <PolicyAvailable Level="FAIL" />
                <PolicyHashMatch Level="FAIL" />
                <AcceptableFormats Level="FAIL">
                        <Id>*</Id>
                </AcceptableFormats>
                <BasicSignatureConstraints>
                        <ReferenceDataExistence Level="FAIL" />
                        <ReferenceDataIntact Level="FAIL" />
                        <SignatureIntact Level="FAIL" />
                        <ProspectiveCertificateChain Level="FAIL" />
<!--                         <TrustedServiceTypeIdentifier Level="WARN"> -->
<!--                                 <Id>http://uri.etsi.org/TrstSvc/Svctype/CA/QC</Id> -->
<!--                         </TrustedServiceTypeIdentifier> -->
<!--                         <TrustedServiceStatus Level="FAIL"> -->
<!--                                 <Id>http://uri.etsi.org/TrstSvc/TrustedList/Svcstatus/undersupervision</Id> -->
<!--                                 <Id>http://uri.etsi.org/TrstSvc/TrustedList/Svcstatus/accredited</Id> -->
<!--                                 <Id>http://uri.etsi.org/TrstSvc/TrustedList/Svcstatus/supervisionincessation</Id> -->
<!--                                 <Id>http://uri.etsi.org/TrstSvc/TrustedList/Svcstatus/granted</Id> -->
<!--                                 <Id>http://uri.etsi.org/TrstSvc/TrustedList/Svcstatus/withdrawn</Id> -->
<!--                         </TrustedServiceStatus> -->
                        <SigningCertificate>
                                <Recognition Level="FAIL" />
                                <Signature Level="FAIL" />
                                <NotExpired Level="FAIL" />
                                <AuthorityInfoAccessPresent Level="WARN" />
                                <RevocationInfoAccessPresent Level="WARN" />
                                <RevocationDataAvailable Level="FAIL" />
                                <RevocationDataNextUpdatePresent Level="WARN" />
                                <RevocationDataFreshness Level="WARN" />
                                <KeyUsage Level="WARN">
                                        <Id>nonRepudiation</Id>
                                </KeyUsage>
                                <SerialNumberPresent Level="WARN" />
                                <NotRevoked Level="FAIL" />
                                <NotOnHold Level="FAIL" />
<!--                                 <Qualification Level="WARN" /> -->
<!--                                 <SupportedByQSCD Level="WARN" /> -->
<!--                                 <IssuedToNaturalPerson Level="INFORM" /> -->
<!--                                 <IssuedToLegalPerson Level="INFORM" /> -->
                                <UsePseudonym Level="INFORM" />
                                <Cryptographic Level="FAIL">
                                        <AcceptableEncryptionAlgo>
                                                <Algo>RSA</Algo>
                                                <Algo>DSA</Algo>
                                                <Algo>ECDSA</Algo>
                                        </AcceptableEncryptionAlgo>
                                        <MiniPublicKeySize>
                                                <Algo Size="128">DSA</Algo>
                                                <Algo Size="1024">RSA</Algo>
                                                <Algo Size="192">ECDSA</Algo>
                                        </MiniPublicKeySize>
                                        <AcceptableDigestAlgo>
                                                <Algo>SHA1</Algo>
                                                <Algo>SHA224</Algo>
                                                <Algo>SHA256</Algo>
                                                <Algo>SHA384</Algo>
                                                <Algo>SHA512</Algo>
                                                <Algo>RIPEMD160</Algo>
                                        </AcceptableDigestAlgo>
                                </Cryptographic>
                        </SigningCertificate>
                        <CACertificate>
                                <Signature Level="FAIL" />
                                <NotExpired Level="FAIL" />
                                <RevocationDataAvailable Level="FAIL" />
                                <RevocationDataNextUpdatePresent Level="WARN" />
                                <RevocationDataFreshness Level="WARN" />
                                <NotRevoked Level="FAIL" />
                                <NotOnHold Level="FAIL" />
                                <Cryptographic Level="FAIL">
                                        <AcceptableEncryptionAlgo>
                                                <Algo>RSA</Algo>
                                                <Algo>DSA</Algo>
                                                <Algo>ECDSA</Algo>
                                        </AcceptableEncryptionAlgo>
                                        <MiniPublicKeySize>
                                                <Algo Size="128">DSA</Algo>
                                                <Algo Size="1024">RSA</Algo>
                                                <Algo Size="192">ECDSA</Algo>
                                        </MiniPublicKeySize>
                                        <AcceptableDigestAlgo>
                                                <Algo>SHA1</Algo>
                                                <Algo>SHA224</Algo>
                                                <Algo>SHA256</Algo>
                                                <Algo>SHA384</Algo>
                                                <Algo>SHA512</Algo>
                                                <Algo>RIPEMD160</Algo>
                                        </AcceptableDigestAlgo>
                                </Cryptographic>
                        </CACertificate>
                        <Cryptographic Level="FAIL">
                                <AcceptableEncryptionAlgo>
                                        <Algo>RSA</Algo>
                                        <Algo>DSA</Algo>
                                        <Algo>ECDSA</Algo>
                                </AcceptableEncryptionAlgo>
                                <MiniPublicKeySize>
                                        <Algo Size="128">DSA</Algo>
                                        <Algo Size="1024">RSA</Algo>
                                        <Algo Size="192">ECDSA</Algo>
                                </MiniPublicKeySize>
                                <AcceptableDigestAlgo>
                                        <Algo>SHA1</Algo>
                                        <Algo>SHA224</Algo>
                                        <Algo>SHA256</Algo>
                                        <Algo>SHA384</Algo>
                                        <Algo>SHA512</Algo>
                                        <Algo>RIPEMD160</Algo>
                                </AcceptableDigestAlgo>
                        </Cryptographic>
                </BasicSignatureConstraints>
                <SignedAttributes>
                        <SigningCertificatePresent Level="FAIL" />
                        <SigningCertificateSigned Level="FAIL" />
                        <CertDigestPresent Level="FAIL" />
                        <CertDigestMatch Level="FAIL" />
                        <IssuerSerialMatch Level="WARN" />
                        <SigningTime Level="FAIL" />
<!--                <ContentType Level="FAIL" value="1.2.840.113549.1.7.1" />
                        <ContentHints Level="FAIL" value="*" />
                        <CommitmentTypeIndication Level="FAIL">
                                <Id>1.2.840.113549.1.9.16.6.1</Id>
                                <Id>1.2.840.113549.1.9.16.6.4</Id>
                                <Id>1.2.840.113549.1.9.16.6.5</Id>
                                <Id>1.2.840.113549.1.9.16.6.6</Id>
                        </CommitmentTypeIndication>
                        <SignerLocation Level="FAIL" />
                        <ContentTimeStamp Level="FAIL" /> -->
                </SignedAttributes>
                <UnsignedAttributes>
<!--                <CounterSignature Level="IGNORE" /> check presence -->
                </UnsignedAttributes>
        </SignatureConstraints>
        <Timestamp>
                <TimestampDelay Level="FAIL" Unit="DAYS" Value="0" />
                <MessageImprintDataFound Level="FAIL" />
                <MessageImprintDataIntact Level="FAIL" />
                <RevocationTimeAgainstBestSignatureTime        Level="FAIL" />
                <BestSignatureTimeBeforeIssuanceDateOfSigningCertificate Level="FAIL" />
                <SigningCertificateValidityAtBestSignatureTime Level="FAIL" />
                <AlgorithmReliableAtBestSignatureTime Level="FAIL" />
                <Coherence Level="WARN" />
                <BasicSignatureConstraints>
                        <ReferenceDataExistence Level="FAIL" />
                        <ReferenceDataIntact Level="FAIL" />
                        <SignatureIntact Level="FAIL" />
                        <ProspectiveCertificateChain Level="WARN" />
                        <SigningCertificate>
                                <Recognition Level="FAIL" />
                                <Signature Level="FAIL" />
                                <NotExpired Level="FAIL" />
                                <RevocationDataAvailable Level="FAIL" />
                                <RevocationDataNextUpdatePresent Level="WARN" />
                                <RevocationDataFreshness Level="WARN" />
                                <NotRevoked Level="FAIL" />
                                <NotOnHold Level="FAIL" />
                                <Cryptographic Level="FAIL">
                                        <AcceptableEncryptionAlgo>
                                                <Algo>RSA</Algo>
                                                <Algo>DSA</Algo>
                                                <Algo>ECDSA</Algo>
                                        </AcceptableEncryptionAlgo>
                                        <MiniPublicKeySize>
                                                <Algo Size="128">DSA</Algo>
                                                <Algo Size="1024">RSA</Algo>
                                                <Algo Size="192">ECDSA</Algo>
                                        </MiniPublicKeySize>
                                        <AcceptableDigestAlgo>
                                                <Algo>SHA1</Algo>
                                                <Algo>SHA224</Algo>
                                                <Algo>SHA256</Algo>
                                                <Algo>SHA384</Algo>
                                                <Algo>SHA512</Algo>
                                                <Algo>RIPEMD160</Algo>
                                        </AcceptableDigestAlgo>
                                </Cryptographic>
                        </SigningCertificate>
                        <CACertificate>
                                <Signature Level="FAIL" />
                                <NotExpired Level="FAIL" />
                                <RevocationDataAvailable Level="WARN" />
                                <RevocationDataNextUpdatePresent Level="WARN" />
                                <RevocationDataFreshness Level="WARN" />
                                <NotRevoked Level="FAIL" />
                                <NotOnHold Level="FAIL" />
                                <Cryptographic Level="FAIL">
                                        <AcceptableEncryptionAlgo>
                                                <Algo>RSA</Algo>
                                                <Algo>DSA</Algo>
                                                <Algo>ECDSA</Algo>
                                        </AcceptableEncryptionAlgo>
                                        <MiniPublicKeySize>
                                                <Algo Size="128">DSA</Algo>
                                                <Algo Size="1024">RSA</Algo>
                                                <Algo Size="192">ECDSA</Algo>
                                        </MiniPublicKeySize>
                                        <AcceptableDigestAlgo>
                                                <Algo>SHA1</Algo>
                                                <Algo>SHA224</Algo>
                                                <Algo>SHA256</Algo>
                                                <Algo>SHA384</Algo>
                                                <Algo>SHA512</Algo>
                                                <Algo>RIPEMD160</Algo>
                                        </AcceptableDigestAlgo>
                                </Cryptographic>
                        </CACertificate>
                        <Cryptographic Level="FAIL">
                                <AcceptableEncryptionAlgo>
                                        <Algo>RSA</Algo>
                                        <Algo>DSA</Algo>
                                        <Algo>ECDSA</Algo>
                                </AcceptableEncryptionAlgo>
                                <MiniPublicKeySize>
                                        <Algo Size="128">DSA</Algo>
                                        <Algo Size="1024">RSA</Algo>
                                        <Algo Size="192">ECDSA</Algo>
                                </MiniPublicKeySize>
                                <AcceptableDigestAlgo>
                                        <Algo>SHA1</Algo>
                                        <Algo>SHA224</Algo>
                                        <Algo>SHA256</Algo>
                                        <Algo>SHA384</Algo>
                                        <Algo>SHA512</Algo>
                                        <Algo>RIPEMD160</Algo>
                                </AcceptableDigestAlgo>
                        </Cryptographic>
                </BasicSignatureConstraints>
        </Timestamp>
        <Revocation>
                <RevocationFreshness Level="FAIL" Unit="DAYS" Value="0" />
                <BasicSignatureConstraints>
                        <ReferenceDataExistence Level="FAIL" />
                        <ReferenceDataIntact Level="FAIL" />
                        <SignatureIntact Level="FAIL" />
                        <ProspectiveCertificateChain Level="WARN" />
                        <SigningCertificate>
                                <Recognition Level="FAIL" />
                                <Signature Level="FAIL" />
                                <NotExpired Level="FAIL" />
                                <RevocationDataAvailable Level="FAIL" />
                                <RevocationDataNextUpdatePresent Level="WARN" />
                                <RevocationDataFreshness Level="WARN" />
                                <NotRevoked Level="FAIL" />
                                <NotOnHold Level="FAIL" />
                                <Cryptographic Level="WARN">
                                        <AcceptableEncryptionAlgo>
                                                <Algo>RSA</Algo>
                                                <Algo>DSA</Algo>
                                                <Algo>ECDSA</Algo>
                                        </AcceptableEncryptionAlgo>
                                        <MiniPublicKeySize>
                                                <Algo Size="128">DSA</Algo>
                                                <Algo Size="1024">RSA</Algo>
                                                <Algo Size="192">ECDSA</Algo>
                                        </MiniPublicKeySize>
                                        <AcceptableDigestAlgo>
                                                <Algo>SHA1</Algo>
                                                <Algo>SHA224</Algo>
                                                <Algo>SHA256</Algo>
                                                <Algo>SHA384</Algo>
                                                <Algo>SHA512</Algo>
                                                <Algo>RIPEMD160</Algo>
                                        </AcceptableDigestAlgo>
                                </Cryptographic>
                        </SigningCertificate>
                        <CACertificate>
                                <Signature Level="FAIL" />
                                <NotExpired Level="FAIL" />
                                <RevocationDataAvailable Level="WARN" />
                                <RevocationDataNextUpdatePresent Level="WARN" />
                                <RevocationDataFreshness Level="WARN" />
                                <NotRevoked Level="FAIL" />
                                <NotOnHold Level="FAIL" />
                                <Cryptographic Level="FAIL">
                                        <AcceptableEncryptionAlgo>
                                                <Algo>RSA</Algo>
                                                <Algo>DSA</Algo>
                                                <Algo>ECDSA</Algo>
                                        </AcceptableEncryptionAlgo>
                                        <MiniPublicKeySize>
                                                <Algo Size="128">DSA</Algo>
                                                <Algo Size="1024">RSA</Algo>
                                                <Algo Size="192">ECDSA</Algo>
                                        </MiniPublicKeySize>
                                        <AcceptableDigestAlgo>
                                                <Algo>SHA1</Algo>
                                                <Algo>SHA224</Algo>
                                                <Algo>SHA256</Algo>
                                                <Algo>SHA384</Algo>
                                                <Algo>SHA512</Algo>
                                                <Algo>RIPEMD160</Algo>
                                        </AcceptableDigestAlgo>
                                </Cryptographic>
                        </CACertificate>
                        <Cryptographic Level="FAIL">
                                <AcceptableEncryptionAlgo>
                                        <Algo>RSA</Algo>
                                        <Algo>DSA</Algo>
                                        <Algo>ECDSA</Algo>
                                </AcceptableEncryptionAlgo>
                                <MiniPublicKeySize>
                                        <Algo Size="128">DSA</Algo>
                                        <Algo Size="1024">RSA</Algo>
                                        <Algo Size="192">ECDSA</Algo>
                                </MiniPublicKeySize>
                                <AcceptableDigestAlgo>
                                        <Algo>SHA1</Algo>
                                        <Algo>SHA224</Algo>
                                        <Algo>SHA256</Algo>
                                        <Algo>SHA384</Algo>
                                        <Algo>SHA512</Algo>
                                        <Algo>RIPEMD160</Algo>
                                </AcceptableDigestAlgo>
                        </Cryptographic>
                </BasicSignatureConstraints>
        </Revocation>
        <Cryptographic />
        <!-- <Cryptographic> <AlgoExpirationDate Format="yyyy-MM-dd"> <Algo Date="2017-02-24">SHA1</Algo> <Algo Date="2035-02-24">SHA224</Algo> <Algo Date="2035-02-24">SHA256</Algo> <Algo
                Date="2035-02-24">SHA384</Algo> <Algo Date="2035-02-24">SHA512</Algo> <Algo Date="2017-02-24">RIPEMD160</Algo> <Algo Date="2017-02-24">DSA128</Algo> <Algo Date="2015-02-24">RSA1024</Algo>
                <Algo Date="2015-02-24">RSA1536</Algo> <Algo Date="2020-02-24">RSA2048</Algo> <Algo Date="2020-02-24">RSA3072</Algo> <Algo Date="2035-02-24">RSA4096</Algo> <Algo Date="2035-02-24">ECDSA192</Algo>
                <Algo Date="2035-02-24">ECDSA256</Algo> </AlgoExpirationDate> </Cryptographic> -->

        <!-- eIDAS REGL 910/EU/2014 -->
        <eIDAS>
                <TLFreshness Level="WARN" Unit="HOURS" Value="6" />
                <TLNotExpired Level="FAIL" />
                <TLWellSigned Level="WARN" />
                <TLVersion Level="FAIL" value="5" />
                <TLConsistency Level="FAIL" />
        </eIDAS>
</ConstraintsParameters>

CAdES signature and validation

To familiarise yourself with this type of signature it is advisable to read the following document:

  • CAdES Specifications (cf. [R02])

To implement this form of signature you can use the XAdES examples. You only need to instantiate the CAdES object service and change the SignatureLevel parameter value. Below is an example of the CAdES-Baseline-B signature:

SignXmlCadesBTest.java
// Preparing parameters for the CAdES signature
CAdESSignatureParameters parameters = new CAdESSignatureParameters();
// We choose the level of the signature (-B, -T, -LT, -LTA).
parameters.setSignatureLevel(SignatureLevel.CAdES_BASELINE_B);
// We choose the type of the signature packaging (ENVELOPING, DETACHED).
parameters.setSignaturePackaging(SignaturePackaging.ENVELOPING);
// We set the digest algorithm to use with the signature algorithm. You must use the
// same parameter when you invoke the method sign on the token. The default value is
// SHA256
parameters.setDigestAlgorithm(DigestAlgorithm.SHA256);

// We set the signing certificate
parameters.setSigningCertificate(privateKey.getCertificate());
// We set the certificate chain
parameters.setCertificateChain(privateKey.getCertificateChain());

// Create common certificate verifier
CommonCertificateVerifier commonCertificateVerifier = new CommonCertificateVerifier();
// Create CAdES xadesService for signature
CAdESService service = new CAdESService(commonCertificateVerifier);

// Get the SignedInfo segment that need to be signed.
ToBeSigned dataToSign = service.getDataToSign(toSignDocument, parameters);

// This function obtains the signature value for signed information using the
// private key and specified algorithm
DigestAlgorithm digestAlgorithm = parameters.getDigestAlgorithm();
SignatureValue signatureValue = signingToken.sign(dataToSign, digestAlgorithm, privateKey);

// We invoke the xadesService to sign the document with the signature value obtained in
// the previous step.
DSSDocument signedDocument = service.signDocument(toSignDocument, parameters, signatureValue);

PAdES signature and validation

The standard ISO 32000-1 (cf. [R05]) allows defining a file format for portable electronic documents. It is based on PDF 1.7 of Adobe Systems. Concerning the digital signature it supports three operations:

  • Adding a digital signature to a document,

  • Providing a placeholder field for signatures,

  • Checking signatures for validity.

PAdES defines eight different profiles to be used with advanced electronic signature in the meaning of European Union Directive 1999/93/EC (cf. [R06]):

  • PAdES Basic - PDF signature as specified in ISO 32000-1 (cf. [R05]). The profile is specified in ETSI EN 319 142 (cf. [R03]).

  • PAdES-BES Profile - based upon CAdES-BES as specified in ETSI EN 319 122 (cf. [R02]) with the option of a signature time-stamp (CAdES-T).

  • PAdES-EPES profile - based upon CAdES-EPES as specified in ETSI EN 319 122 (cf. [R02]). This profile is the same as the PAdES - BES with the addition of a signature policy identifier and optionally a commitment type indication.

  • PAdES-LTV Profile - This profile supports the long term validation of PDF Signatures and can be used in conjunction with the above-mentioned profiles.

  • Four other PAdES profiles for XML Content.

To familiarise yourself with this type of signature it is advisable to read the documents referenced above.

Below is an example of code to perform a PAdES-BASELINE-B type signature:

SignPdfPadesBTest.java
// Preparing parameters for the PAdES signature
PAdESSignatureParameters parameters = new PAdESSignatureParameters();
// We choose the level of the signature (-B, -T, -LT, -LTA).
parameters.setSignatureLevel(SignatureLevel.PAdES_BASELINE_B);
// We choose the type of the signature packaging (ENVELOPING, DETACHED).
parameters.setSignaturePackaging(SignaturePackaging.ENVELOPED);
// We set the digest algorithm to use with the signature algorithm. You must use the
// same parameter when you invoke the method sign on the token. The default value is
// SHA256
parameters.setDigestAlgorithm(DigestAlgorithm.SHA256);

// We set the signing certificate
parameters.setSigningCertificate(privateKey.getCertificate());
// We set the certificate chain
parameters.setCertificateChain(privateKey.getCertificateChain());

// Create common certificate verifier
CommonCertificateVerifier commonCertificateVerifier = new CommonCertificateVerifier();
// Create PAdESService for signature
PAdESService service = new PAdESService(commonCertificateVerifier);

// Get the SignedInfo segment that need to be signed.
ToBeSigned dataToSign = service.getDataToSign(toSignDocument, parameters);

// This function obtains the signature value for signed information using the
// private key and specified algorithm
DigestAlgorithm digestAlgorithm = parameters.getDigestAlgorithm();
SignatureValue signatureValue = signingToken.sign(dataToSign, digestAlgorithm, privateKey);

// We invoke the xadesService to sign the document with the signature value obtained in
// the previous step.
DSSDocument signedDocument = service.signDocument(toSignDocument, parameters, signatureValue);

To add the timestamp to the signature (PAdES-T or LTA), please provide TSP source to the service.

To create PAdES-BASELINE-B level with additional options: signature policy identifier and optionally a commitment type indication, please observe the following example in code 5.

All these parameters are optional.

  • SignaturePolicyOID : The string representation of the OID of the signature policy to use when signing.

  • SignaturePolicyHashValue : The value of the hash of the signature policy, computed the same way as in clause 5.2.9 of CAdES (ETSI EN 319 122 (cf. [R02])).

  • SignaturePolicyHashAlgorithm : The hash function used to compute the value of the SignaturePolicyHashValue entry. Entries must be represented the same way as in table 257 of ISO 32000-1 (cf. [R05]).

  • SignaturePolicyCommitmentType : If the SignaturePolicyOID is present, this array defines the commitment types that can be used within the signature policy. An empty string can be used to indicate the default commitment type.

If the SignaturePolicyOID is absent, the three other fields defined above will be ignored. If the SignaturePolicyOID is present but the SignaturePolicyCommitmentType is absent, all commitments defined by the signature policy will be used.

The extension of a signature of the level PAdES-BASELINE-B up to PAdES-BASELINE-LTA profile will add the following features:

  • Addition of validation data to an existing PDF document which may be used to validate earlier signatures within the document (including PDF signatures and time-stamp signatures).

  • Addition of a document time-stamp which protects the existing document and any validation data.

  • Further validation data and document time-stamp may be added to a document over time to maintain its authenticity and integrity.

PAdES Visible Signature

The framework also allows to create PDF files with visible signature as specified in ETSI EN 319 142 (cf. [R03]). In the SignatureParameters object, there’s a special attribute named ImageParameters. This parameter let you custom the visual signature (with text, with image or with image and text). Below is an example of code to perform a PADES-BASELINE-B type signature with a visible signature:

SignPdfPadesBVisibleTest.java
// Preparing parameters for the PAdES signature
PAdESSignatureParameters parameters = new PAdESSignatureParameters();
// We choose the level of the signature (-B, -T, -LT, -LTA).
parameters.setSignatureLevel(SignatureLevel.PAdES_BASELINE_B);
// We choose the type of the signature packaging (ENVELOPING, DETACHED).
parameters.setSignaturePackaging(SignaturePackaging.ENVELOPED);

// We set the signing certificate
parameters.setSigningCertificate(privateKey.getCertificate());
// We set the certificate chain
parameters.setCertificateChain(privateKey.getCertificateChain());

// Initialize visual signature
SignatureImageParameters imageParameters = new SignatureImageParameters();
// the origin is the left and top corner of the page
imageParameters.setxAxis(200);
imageParameters.setyAxis(500);

// Initialize text to generate for visual signature
SignatureImageTextParameters textParameters = new SignatureImageTextParameters();
textParameters.setFont(new Font("serif", Font.PLAIN, 14));
textParameters.setTextColor(Color.BLUE);
textParameters.setText("My visual signature");
imageParameters.setTextParameters(textParameters);

parameters.setSignatureImageParameters(imageParameters);

// Create common certificate verifier
CommonCertificateVerifier commonCertificateVerifier = new CommonCertificateVerifier();
// Create PAdESService for signature
PAdESService service = new PAdESService(commonCertificateVerifier);

// Get the SignedInfo segment that need to be signed.
ToBeSigned dataToSign = service.getDataToSign(toSignDocument, parameters);

// This function obtains the signature value for signed information using the
// private key and specified algorithm
DigestAlgorithm digestAlgorithm = parameters.getDigestAlgorithm();
SignatureValue signatureValue = signingToken.sign(dataToSign, digestAlgorithm, privateKey);

// We invoke the xadesService to sign the document with the signature value obtained in
// the previous step.
DSSDocument signedDocument = service.signDocument(toSignDocument, parameters, signatureValue);

ASiC signature and validation

When creating a digital signature, the user must choose between different packaging elements, namely enveloping, enveloped or detached. This choice is not obvious, because in one case the signature will alter the signed document and in the other case it is possible to lose the association between the signed document and its signature. That’s where the standard ETSI EN 319 162 (cf. [R04]) offers a standardized use of container forms to establish a common way for associating data objects with advanced signatures or time-stamp tokens.

A number of application environments use ZIP based container formats to package sets of files together with meta-information. ASiC technical specification is designed to operate with a range of such ZIP based application environments. Rather than enforcing a single packaging structure, ASiC describes how these package formats can be used to associate advanced electronic signatures with any data objects.

The standard defines two types of containers; the first (ASiC-S) allows you to associate one or more signatures with a single data element. In this case the structure of the signature can be based (in a general way) on a single CAdES signature or on multiple XAdES signatures or finally on a single TST; the second is an extended container (ASiC-E) that includes multiple data objects. Each data object may be signed by one or more signatures which structure is similar to ASiC-S. This second type of container is compatible with OCF, UCF and ODF formats.

For the moment the DSS framework has some restriction on the containers you can generate, depending on the input file. If the input file is already an ASiC container, the output container must be the same type of container based on the same type of signature. If the input is any other file, the output does not have any restriction.

Input Output

ASiC-S CAdES

ASiC-S CAdES

ASiC-S XAdES

ASiC-S XAdES

ASiC-E CAdES

ASiC-E CAdES

ASiC-E XAdES

ASiC-E XAdES

Binary

ASiC-S CAdES, ASiC-S XAdES, ASiC-E CAdES, ASiC-E XAdES

This is an example of the source code for signing a document using ASiCS-S based on XAdES-B:

SignPdfASiCSBTest.java
// Preparing parameters for the AsicS signature
ASiCWithXAdESSignatureParameters parameters = new ASiCWithXAdESSignatureParameters();
// We choose the level of the signature (-B, -T, -LT, LTA).
parameters.setSignatureLevel(SignatureLevel.XAdES_BASELINE_B);
// We choose the container type (ASiC-S or ASiC-E)
parameters.aSiC().setContainerType(ASiCContainerType.ASiC_S);

// We set the digest algorithm to use with the signature algorithm. You must use the
// same parameter when you invoke the method sign on the token. The default value is
// SHA256
parameters.setDigestAlgorithm(DigestAlgorithm.SHA256);

// We set the signing certificate
parameters.setSigningCertificate(privateKey.getCertificate());
// We set the certificate chain
parameters.setCertificateChain(privateKey.getCertificateChain());

// Create common certificate verifier
CommonCertificateVerifier commonCertificateVerifier = new CommonCertificateVerifier();
// Create ASiC service for signature
ASiCWithXAdESService service = new ASiCWithXAdESService(commonCertificateVerifier);

// Get the SignedInfo segment that need to be signed.
ToBeSigned dataToSign = service.getDataToSign(toSignDocument, parameters);

// This function obtains the signature value for signed information using the
// private key and specified algorithm
DigestAlgorithm digestAlgorithm = parameters.getDigestAlgorithm();
SignatureValue signatureValue = signingToken.sign(dataToSign, digestAlgorithm, privateKey);

// We invoke the xadesService to sign the document with the signature value obtained in
// the previous step.
DSSDocument signedDocument = service.signDocument(toSignDocument, parameters, signatureValue);

This is another example of the source code for signing a document using ASiCS-E based on CAdES:

SignPdfASiCSEWithCAdESTest.java
// Preparing parameters for the AsicE signature
ASiCWithCAdESSignatureParameters parameters = new ASiCWithCAdESSignatureParameters();

// We choose the level of the signature (-B, -T, -LT or -LTA).
parameters.setSignatureLevel(SignatureLevel.CAdES_BASELINE_B);
// We choose the container type (ASiC-S pr ASiC-E)
parameters.aSiC().setContainerType(ASiCContainerType.ASiC_E);

// We set the digest algorithm to use with the signature algorithm. You
// must use the
// same parameter when you invoke the method sign on the token. The
// default value is
// SHA256
parameters.setDigestAlgorithm(DigestAlgorithm.SHA256);

// We set the signing certificate
parameters.setSigningCertificate(privateKey.getCertificate());
// We set the certificate chain
parameters.setCertificateChain(privateKey.getCertificateChain());

// Create common certificate verifier
CommonCertificateVerifier commonCertificateVerifier = new CommonCertificateVerifier();
// Create ASiC service for signature
ASiCWithCAdESService service = new ASiCWithCAdESService(commonCertificateVerifier);

// Get the SignedInfo segment that need to be signed.
ToBeSigned dataToSign = service.getDataToSign(toSignDocument, parameters);

// This function obtains the signature value for signed information
// using the
// private key and specified algorithm
DigestAlgorithm digestAlgorithm = parameters.getDigestAlgorithm();
SignatureValue signatureValue = signingToken.sign(dataToSign, digestAlgorithm, privateKey);

// We invoke the xadesService to sign the document with the signature
// value obtained in
// the previous step.
DSSDocument signedDocument = service.signDocument(toSignDocument, parameters, signatureValue);

Please note that you need to pass only few parameters to the service. Other parameters, although are positioned, will be overwritten by the internal implementation of the service. Therefore, the obtained signature is always based on XAdES and of DETACHED packaging.

It is also possible with the framework DSS to make an extension of an ASiC container to the level XAdES-BASELINE-T or -LT.

Management of signature tokens

The DSS framework is able to create signatures from PKCS#11, PKCS#12 and MS CAPI. Java 6 is inherently capable of communicating with these kinds of KeyStores. To be independent of the signing media, DSS framework uses an interface named SignatureTokenConnection to manage different implementations of the signing process. The base implementation is able to sign a stream of the data in one step. That means that all the data to be signed needs to be sent to the SSCD. This is the case for MS CAPI. As to the PKCS#11 and PKCS#12, which give to the developer a finer control in the signature operation, the DSS framework implements the AsyncSignatureTokenConnection abstract class that permits to execute the digest operation and signature operation in two different threads or even two different hardwares.

This design permits also other card providers/adopters to create own implementations. For example, this can be used for a direct connection to the Smartcard through Java 6 PC/SC.

PKCS#11

PKCS#11 is widely used to access smart cards and HSMs. Most commercial software uses PKCS#11 to access the signature key of the CA or to enrol user certificates. In the DSS framework, this standard is encapsulated in the class Pkcs11SignatureToken.

PKCS11Snippet.java
SignatureTokenConnection token = new Pkcs11SignatureToken("C:\\Windows\\System32\\beidpkcs11.dll");

List<DSSPrivateKeyEntry> keys = token.getKeys();
for (DSSPrivateKeyEntry entry : keys) {
        System.out.println(entry.getCertificate().getCertificate());
}

ToBeSigned toBeSigned = new ToBeSigned("Hello world".getBytes());
SignatureValue signatureValue = token.sign(toBeSigned, DigestAlgorithm.SHA256, keys.get(0));

System.out.println("Signature value : " + Utils.toBase64(signatureValue.getValue()));

PKCS#12

This standard defines a file format commonly used to store the private key and corresponding public key certificate protecting them by password.

In order to use this format with the DSS framework you have to go through the class Pkcs12SignatureToken.

PKCS12Snippet.java
SignatureTokenConnection token = new Pkcs12SignatureToken("src/main/resources/user_a_rsa.p12", "password");

List<DSSPrivateKeyEntry> keys = token.getKeys();
for (DSSPrivateKeyEntry entry : keys) {
        System.out.println(entry.getCertificate().getCertificate());
}

ToBeSigned toBeSigned = new ToBeSigned("Hello world".getBytes());
SignatureValue signatureValue = token.sign(toBeSigned, DigestAlgorithm.SHA256, keys.get(0));

System.out.println("Signature value : " + Utils.toBase64(signatureValue.getValue()));

MS CAPI

If the middleware for communicating with an SSDC provides a CSP based on MS CAPI specification, then to sign the documents you can use MSCAPISignatureToken class.

MSCAPISnippet.java
SignatureTokenConnection token = new MSCAPISignatureToken();

List<DSSPrivateKeyEntry> keys = token.getKeys();
for (DSSPrivateKeyEntry entry : keys) {
        System.out.println(entry.getCertificate().getCertificate());
}

ToBeSigned toBeSigned = new ToBeSigned("Hello world".getBytes());
SignatureValue signatureValue = token.sign(toBeSigned, DigestAlgorithm.SHA256, keys.get(0));

System.out.println("Signature value : " + Utils.toBase64(signatureValue.getValue()));

Other Implementations

As you can see, it is easy to add another implementation of the SignatureTokenConnection, thus enabling the framework to use other API than the provided three (PKCS#11, PKCS#12 and MS CAPI). For example, it is likely that in the future PC/SC will be the preferred way of accessing a Smartcard. Although PKCS#11 is currently the most used API, DSS framework is extensible and can use PC/SC. For our design example we propose to use PC/SC to communicate with the Smartcard.

Management of certificates sources

The validation of a certificate requires the access to some other certificates from multiple sources like trusted lists, trust store, the signature itself: certificates can be contained inside or any other source. Within the framework, an X509 certificate is modelled through the class:

  • eu.europa.esig.dss.x509.CertificateToken

This encapsulation helps make certificate handling more suited to the needs of the validation in the context of trust. Each certificate is unambiguously identified by its issuer DN and serial number. The framework associates a unique internal identifier to each certificate but this identifier is not calculated on the data contained in the certificate and therefore varies from one application to another. However, it is independent of its source. It allows to easily comparing certificates issued by different sources. Certificate tokens are grouped into pools. A certificate token can be declared in several pools. The class that models a pool is called:

  • eu.europa.esig.dss.x509.CertificatePool

This class allows keeping only one occurrence of the certificate in the given context (i.e. validation). Two pools of certificates can be merged using the method:

  • eu.europa.esig.dss.x509.CertificatePool#merge

The CertificateSource interface provides abstraction for accessing a certificate, regardless of the source. However, each source has its own type:

  • eu.europa.esig.dss.x509.CertificateSourceType

This information is used, for example, to distinguish between the certificate from a trusted source and the others. A source has one and only one type, but a certificate token can be found in multiple sources. The DSS framework supplies some standard implementations, but also gives the possibility to implement owner solutions. Among the standard solutions you can find:

  • eu.europa.esig.dss.x509.CommonCertificateSource

This is the superclass of almost of the certificate sources. It implements the common method CommonCertificateSource#get returns the list of CertificateToken(s) corresponding to the given subject distinguished name. Note that the content of the encapsulated certificates pool can be different from the content of the source. Only CertificateToken(s) present in the source are taken into account. It exposes also the method CommonCertificateSource#addCertificate which gives the possibility to add manually any X509Certificate as a part of this source and as a part of the encapsulated pool. If the certificate is already present in the pool its source type is associated to the token.

  • eu.europa.esig.dss.x509.SignatureCertificateSource

Some certificate sources are based on data encapsulated within the signature. That means that the set of certificates is available and the software only needs to find the certificate using its subject name. This class adds also new methods to obtain specialized list of certificates contained in the source:.

  • SignatureCertificateSource#getKeyInfoCertificates

  • SignatureCertificateSource#getEncapsulatedCertificates

    • eu.europa.esig.dss.tsl.TrustedListsCertificateSource

Certificates coming from the list of Trusted Lists. This class gives the mechanism to define the set of trusted certificates (trust anchors). They are used in the validation process to decide if the prospective certificate chain has a trust anchor. See chapter 5.2 to know more about EU Trusted Lists.

Management of CRL and OCSP sources

A CRL is a time-stamped list identifying revoked certificates. It is signed by a Certificate Authority (CA) and made freely available in a public repository. Each revoked certificate is identified in a CRL by its certificate serial number. The Online Certificate Status Protocol (OCSP) is an Internet protocol used for obtaining the revocation status of an X.509 digital certificate. For every certificate, the validity has to be checked via CRL or OCSP responses. The information may originate from different CRLSources or OCSPSources: For easing the usage of such sources, DSS implements a CRLSource and OCSPSource interfaces, which offer a generic, uniform way of accessing CRL and OCSP sources. Furthermore, a caching mechanism can be easily attached to those sources, optimizing the access time to revocation information by reducing network connections to online servers. The interface CRLSource defines the method which returns CRLToken for the given certificate:

CRLToken findCrl(CertificateToken certificateToken) throws DSSException;

The interface OCSPSource defines the method which returns OCSPToken for the given certificate/issuer certificate couple:

OCSPToken getOCSPToken(CertificateToken certificateToken, CertificateToken issuerCertificateToken);

We use these classes during the certificate validation process through "validationContext" object (based on ValidationContext class) which is a "cache" for one validation request that contains every object retrieved so far. This object in turn instantiates a "verifier" based on CSPAndCRLCertificateVerifier class whose role is to fetch revocation data by querying an OCSP server first and then a CRL server if no OCSP response could be retrieved. In general we can distinguish three main sources:

  • Offline sources;

  • Online sources;

  • Sources with the cache mechanism.

Other implementations of CRL and OCSP Sources

Such sources find the status of a certificate either from a list stored locally or using the information contained in the advanced signature or online way. Here is the list of sources already implemented in the DSS framework:

  • CRL sources

    • JdbcCacheCRLSource : Retrieves information from a JDBC datasource

    • OfflineCRLSource : This class that implements in a generic way the findCrl method that operates on the different CRLs implemented in children classes.

      • ListCRLSource : This source maintains a list of CRLToken.

      • SignatureCRLSource : The advanced signature contains a list of CRL that was needed to validate the signature. This class is a basic skeleton that is able to retrieve the needed CRL from a list. The child needs to retrieve the list of wrapped CRLs.

        • CAdESCRLSource : Retrieves information from a CAdES signature.

        • PAdESCRLSource : Retrieves information from a PAdES signature.

        • XAdESCRLSource : Retrieves information from a XAdES signature.

        • MockCRLSource : A class of test that can instantiate a list of certificate revocation lists from a directory where should be the individual lists (each individual list file must end with the extension ".crl").

    • OnlineCRLSource : This is a representation of an Online CRL repository. This implementation will contact using HTTP protocol the CRL Responder to download the CRLs from the given URI. Note that certificate"s Authority Information Access (AIA) extension is used to find issuer’s resources location like CRT file and/or Online Certificate Status Protocol (OCSP). The URIs of CRL server will be extracted from this property (OID value: 1.3.6.1.5.5.7.48.1.3).

  • OCSP sources

    • OfflineOCSPSource : An abstract class that helps to implement OCSPSource with an already loaded list of OCSPToken. It implements in a generic way the getOCSPResponse method that operates on the different OCSP implementations in children classes.

      • ListOCSPSource : Implements an OCSPSource from a list of OCSPToken.

      • SignatureOCSPSource : The advanced signature contains a list of OCSPResp that was needed to validate the signature. This class is a basic skeleton that is able to retrieve the needed OCSPResp from a list. The children need to retrieve the list of wrapped OCSPResp.

        • CAdESOCSPSource : Retrieves information from a CAdES signature.

        • PAdESOCSPSource : Retrieves information from a PAdES signature.

        • XAdESOCSPSource : Retrieves information from a XAdES signature.

        • MockOCSPSource : A class of test that can instantiate a list of OCSPToken from a directory where should be the individual DER Encoded X509 certificates files (each individual file must end with the extension ".der").

    • OnlineOCSPSource : This is a representation of an Online OCSP repository. This implementation will contact using HTTP protocol the OCSP Responder to retrieve the OCSP response. Note that certificate’s Authority Information Access (AIA) extension is used to find issuer’s resources location like CRT file and/or Online Certificate Status Protocol (OCSP). The URIs of OCSP server will be extracted from this property (OID value: 1.3.6.1.5.5.7.48.1).

TSP Sources

The Time Stamp Authority by creating time-stamp tokens provides independent and irrefutable proof of time for business transactions, e-documents and digital signatures. The TSA must comply with the IETF RFC 3161 specifications (cf. [R07]). A time-stamp is obtained by sending the digest value of the given data and digest algorithm to the Time Stamp Authority. The returned time-stamp is a signed data that contains the digest value, the identity of the TSA, and the time of stamping. This proves that the given data existed before the time of stamping. The DSS framework proposes TSPSource interface to implement the communication with TSA. The class OnlineTSPSource is the default implementation of TSP using HTTP(S) communication layer. The following bit of Java code illustrates how you might use this class:

OnlineTSPSource.java
final String tspServer = "http://tsa.belgium.be/connect";
OnlineTSPSource tspSource = new OnlineTSPSource(tspServer);

final DigestAlgorithm digestAlgorithm = DigestAlgorithm.SHA256;
final byte[] toDigest = "digest value".getBytes("UTF-8");
final byte[] digestValue = DSSUtils.digest(digestAlgorithm, toDigest);
final TimeStampToken tsr = tspSource.getTimeStampResponse(digestAlgorithm, digestValue);

System.out.println(DSSUtils.toHex(tsr.getEncoded()));

Time-stamp policy:

A time-stamp policy is a "named set of rules that indicates the applicability of a time-stamp token to a particular community and/or class of application with common security requirements". A TSA may define its own policy which enhances the policy defined in RFC 3628. Such a policy shall incorporate or further constrain the requirements identified in RFC 3628. A time-stamp policy may be defined by the user of times-stamp services.

REST Services

DSS offers some REST and SOAP web services. The documentation will covers the REST calls. Additionally, we also provide a SOAP-UI project and Postman samples in the cookbook module.

The different webservices are :

  • Signature webservices (dss-soap / dss-rest and their clients) : they expose methods to allow to sign or extend a signature from a client.

  • Server-signing webservice (dss-server-signing-soap / dss-server-signing-rest and their clients) : they expose method to retrieve keys from a server (PKCS#11, PKCS#12, HSM,…​) and to sign the digest on the server side.

  • Validation webservices (dss-validation-soap / dss-validation-rest and their client) : they expose methods to allow validate a signature, with an optional detached file and an optional validation policy.

The data structure in webservices is similar in REST and SOAP.

REST signature service

This service exposes 3 methods for one or more document(s) :

  • getDataToSign : computes the digest to be signed

  • signDocument : adds the signature value in the document

  • extendDocument : extends an existing signature

Get data to sign

The method allows to retrieve the data to be signed. The user sends the document to be signed, the parameters (signature level,…​) and the certificate chain.

Warning
The parameters in getDataToSign and signDocument MUST be the same (especially the signing date).
Request
POST /services/rest/signature/one-document/getDataToSign HTTP/1.1
Accept: application/json
Content-Type: application/json; charset=UTF-8
Host: localhost:8080
Content-Length: 2369

{
  "parameters" : {
    "signWithExpiredCertificate" : false,
    "signatureLevel" : "CAdES_BASELINE_B",
    "signaturePackaging" : "ENVELOPING",
    "signatureAlgorithm" : "RSA_SHA256",
    "encryptionAlgorithm" : "RSA",
    "digestAlgorithm" : "SHA256",
    "signatureTimestampParameters" : {
      "digestAlgorithm" : "SHA256",
      "canonicalizationMethod" : "http://www.w3.org/2001/10/xml-exc-c14n#"
    },
    "archiveTimestampParameters" : {
      "digestAlgorithm" : "SHA256",
      "canonicalizationMethod" : "http://www.w3.org/2001/10/xml-exc-c14n#"
    },
    "contentTimestampParameters" : {
      "digestAlgorithm" : "SHA256",
      "canonicalizationMethod" : "http://www.w3.org/2001/10/xml-exc-c14n#"
    },
    "signingCertificate" : {
      "encodedCertificate" : "MIIC6jCCAdKgAwIBAgIGLtYU17tXMA0GCSqGSIb3DQEBCwUAMDAxGzAZBgNVBAMMElJvb3RTZWxmU2lnbmVkRmFrZTERMA8GA1UECgwIRFNTLXRlc3QwHhcNMTcwNjA4MTEyNjAxWhcNNDcwNzA0MDc1NzI0WjAoMRMwEQYDVQQDDApTaWduZXJGYWtlMREwDwYDVQQKDAhEU1MtdGVzdDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMI3kZhtnipn+iiZHZ9ax8FlfE5Ow/cFwBTfAEb3R1ZQUp6/BQnBt7Oo0JWBtc9qkv7JUDdcBJXPV5QWS5AyMPHpqQ75Hitjsq/Fzu8eHtkKpFizcxGa9BZdkQjh4rSrtO1Kjs0Rd5DQtWSgkeVCCN09kN0ZsZ0ENY+Ip8QxSmyztsStkYXdULqpwz4JEXW9vz64eTbde4vQJ6pjHGarJf1gQNEc2XzhmI/prXLysWNqC7lZg7PUZUTrdegABTUzYCRJ1kWBRPm4qo0LN405c94QQd45a5kTgowHzEgLnAQI28x0M3A59TKC+ieNc6VF1PsTLpUw7PNI2VstX5jAuasCAwEAAaMSMBAwDgYDVR0PAQH/BAQDAgEGMA0GCSqGSIb3DQEBCwUAA4IBAQCK6LGA01TR+rmU8p6yhAi4OkDN2b1dbIL8l8iCMYopLCxx8xqq3ubZCOxqh1X2j6pgWzarb0b/MUix00IoUvNbFOxAW7PBZIKDLnm6LsckRxs1U32sC9d1LOHe3WKBNB6GZALT1ewjh7hSbWjftlmcovq+6eVGA5cvf2u/2+TkKkyHV/NR394nXrdsdpvygwypEtXjetzD7UT93Nuw3xcV8VIftIvHf9LjU7h+UjGmKXG9c15eYr3SzUmv6kyOI0Bvw14PWtsWGl0QdOSRvIBBrP4adCnGTgjgjk9LTcO8B8FKrr+8lHGuc0bp4lIUToiUkGILXsiEeEg9WAqm+XqO"
    },
    "certificateChain" : [ ],
    "detachedContents" : null,
    "asicContainerType" : null,
    "blevelParams" : {
      "trustAnchorBPPolicy" : true,
      "signingDate" : "2017-06-19T15:20:47.603Z",
      "claimedSignerRoles" : null,
      "certifiedSignerRoles" : null,
      "signaturePolicy" : null,
      "commitmentTypeIndications" : null,
      "signerLocation" : null
    }
  },
  "toSignDocument" : {
    "bytes" : "SGVsbG8=",
    "name" : "RemoteDocument",
    "absolutePath" : "RemoteDocument",
    "mimeType" : null
  }
}
Response
HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Date: Mon, 19 Jun 2017 13:20:47 GMT
Content-Type: application/json
Transfer-Encoding: chunked
Content-Length: 412

{
  "bytes" : "MYIBITAYBgkqhkiG9w0BCQMxCwYJKoZIhvcNAQcBMBwGCSqGSIb3DQEJBTEPFw0xNzA2MTkxNTIwNDdaMC0GCSqGSIb3DQEJNDEgMB4wDQYJYIZIAWUDBAIBBQChDQYJKoZIhvcNAQELBQAwLwYJKoZIhvcNAQkEMSIEIBhfjbMicf4l9WGm/JOLLiZDBuwwTtpRgAfRdkgmOBlpMIGGBgsqhkiG9w0BCRACLzF3MHUwczBxMA0GCWCGSAFlAwQCAQUABCAC8+vKAWMnQlO8gJ0nSY3UG7AxbX5rBmlgEV3hVVidnDA+MDSkMjAwMRswGQYDVQQDDBJSb290U2VsZlNpZ25lZEZha2UxETAPBgNVBAoMCERTUy10ZXN0AgYu1hTXu1c="
}

Sign document

The method allows to generate the signed document with the received signature value.

Warning
The parameters in getDataToSign and signDocument MUST be the same (especially the signing date).
Request
POST /services/rest/signature/one-document/signDocument HTTP/1.1
Accept: application/json
Content-Type: application/json; charset=UTF-8
Host: localhost:8080
Content-Length: 2458

{
  "parameters" : {
    "signWithExpiredCertificate" : false,
    "signatureLevel" : "CAdES_BASELINE_B",
    "signaturePackaging" : "ENVELOPING",
    "signatureAlgorithm" : "RSA_SHA256",
    "encryptionAlgorithm" : "RSA",
    "digestAlgorithm" : "SHA256",
    "signatureTimestampParameters" : {
      "digestAlgorithm" : "SHA256",
      "canonicalizationMethod" : "http://www.w3.org/2001/10/xml-exc-c14n#"
    },
    "archiveTimestampParameters" : {
      "digestAlgorithm" : "SHA256",
      "canonicalizationMethod" : "http://www.w3.org/2001/10/xml-exc-c14n#"
    },
    "contentTimestampParameters" : {
      "digestAlgorithm" : "SHA256",
      "canonicalizationMethod" : "http://www.w3.org/2001/10/xml-exc-c14n#"
    },
    "signingCertificate" : {
      "encodedCertificate" : "MIIC6jCCAdKgAwIBAgIGLtYU17tXMA0GCSqGSIb3DQEBCwUAMDAxGzAZBgNVBAMMElJvb3RTZWxmU2lnbmVkRmFrZTERMA8GA1UECgwIRFNTLXRlc3QwHhcNMTcwNjA4MTEyNjAxWhcNNDcwNzA0MDc1NzI0WjAoMRMwEQYDVQQDDApTaWduZXJGYWtlMREwDwYDVQQKDAhEU1MtdGVzdDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMI3kZhtnipn+iiZHZ9ax8FlfE5Ow/cFwBTfAEb3R1ZQUp6/BQnBt7Oo0JWBtc9qkv7JUDdcBJXPV5QWS5AyMPHpqQ75Hitjsq/Fzu8eHtkKpFizcxGa9BZdkQjh4rSrtO1Kjs0Rd5DQtWSgkeVCCN09kN0ZsZ0ENY+Ip8QxSmyztsStkYXdULqpwz4JEXW9vz64eTbde4vQJ6pjHGarJf1gQNEc2XzhmI/prXLysWNqC7lZg7PUZUTrdegABTUzYCRJ1kWBRPm4qo0LN405c94QQd45a5kTgowHzEgLnAQI28x0M3A59TKC+ieNc6VF1PsTLpUw7PNI2VstX5jAuasCAwEAAaMSMBAwDgYDVR0PAQH/BAQDAgEGMA0GCSqGSIb3DQEBCwUAA4IBAQCK6LGA01TR+rmU8p6yhAi4OkDN2b1dbIL8l8iCMYopLCxx8xqq3ubZCOxqh1X2j6pgWzarb0b/MUix00IoUvNbFOxAW7PBZIKDLnm6LsckRxs1U32sC9d1LOHe3WKBNB6GZALT1ewjh7hSbWjftlmcovq+6eVGA5cvf2u/2+TkKkyHV/NR394nXrdsdpvygwypEtXjetzD7UT93Nuw3xcV8VIftIvHf9LjU7h+UjGmKXG9c15eYr3SzUmv6kyOI0Bvw14PWtsWGl0QdOSRvIBBrP4adCnGTgjgjk9LTcO8B8FKrr+8lHGuc0bp4lIUToiUkGILXsiEeEg9WAqm+XqO"
    },
    "certificateChain" : [ ],
    "detachedContents" : null,
    "asicContainerType" : null,
    "blevelParams" : {
      "trustAnchorBPPolicy" : true,
      "signingDate" : "2017-06-19T15:20:47.448Z",
      "claimedSignerRoles" : null,
      "certifiedSignerRoles" : null,
      "signaturePolicy" : null,
      "commitmentTypeIndications" : null,
      "signerLocation" : null
    }
  },
  "signatureValue" : {
    "algorithm" : "RSA_SHA256",
    "value" : "AQIDBA=="
  },
  "toSignDocument" : {
    "bytes" : "SGVsbG8=",
    "name" : "RemoteDocument",
    "absolutePath" : "RemoteDocument",
    "mimeType" : null
  }
}
Response
HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Date: Mon, 19 Jun 2017 13:20:47 GMT
Content-Type: application/json
Transfer-Encoding: chunked
Content-Length: 1824

{
  "bytes" : "MIIEvwYJKoZIhvcNAQcCoIIEsDCCBKwCAQExDzANBglghkgBZQMEAgEFADAUBgkqhkiG9w0BBwGgBwQFSGVsbG+gggLuMIIC6jCCAdKgAwIBAgIGLtYU17tXMA0GCSqGSIb3DQEBCwUAMDAxGzAZBgNVBAMMElJvb3RTZWxmU2lnbmVkRmFrZTERMA8GA1UECgwIRFNTLXRlc3QwHhcNMTcwNjA4MTEyNjAxWhcNNDcwNzA0MDc1NzI0WjAoMRMwEQYDVQQDDApTaWduZXJGYWtlMREwDwYDVQQKDAhEU1MtdGVzdDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMI3kZhtnipn+iiZHZ9ax8FlfE5Ow/cFwBTfAEb3R1ZQUp6/BQnBt7Oo0JWBtc9qkv7JUDdcBJXPV5QWS5AyMPHpqQ75Hitjsq/Fzu8eHtkKpFizcxGa9BZdkQjh4rSrtO1Kjs0Rd5DQtWSgkeVCCN09kN0ZsZ0ENY+Ip8QxSmyztsStkYXdULqpwz4JEXW9vz64eTbde4vQJ6pjHGarJf1gQNEc2XzhmI/prXLysWNqC7lZg7PUZUTrdegABTUzYCRJ1kWBRPm4qo0LN405c94QQd45a5kTgowHzEgLnAQI28x0M3A59TKC+ieNc6VF1PsTLpUw7PNI2VstX5jAuasCAwEAAaMSMBAwDgYDVR0PAQH/BAQDAgEGMA0GCSqGSIb3DQEBCwUAA4IBAQCK6LGA01TR+rmU8p6yhAi4OkDN2b1dbIL8l8iCMYopLCxx8xqq3ubZCOxqh1X2j6pgWzarb0b/MUix00IoUvNbFOxAW7PBZIKDLnm6LsckRxs1U32sC9d1LOHe3WKBNB6GZALT1ewjh7hSbWjftlmcovq+6eVGA5cvf2u/2+TkKkyHV/NR394nXrdsdpvygwypEtXjetzD7UT93Nuw3xcV8VIftIvHf9LjU7h+UjGmKXG9c15eYr3SzUmv6kyOI0Bvw14PWtsWGl0QdOSRvIBBrP4adCnGTgjgjk9LTcO8B8FKrr+8lHGuc0bp4lIUToiUkGILXsiEeEg9WAqm+XqOMYIBjDCCAYgCAQEwOjAwMRswGQYDVQQDDBJSb290U2VsZlNpZ25lZEZha2UxETAPBgNVBAoMCERTUy10ZXN0AgYu1hTXu1cwDQYJYIZIAWUDBAIBBQCgggEhMBgGCSqGSIb3DQEJAzELBgkqhkiG9w0BBwEwHAYJKoZIhvcNAQkFMQ8XDTE3MDYxOTE1MjA0N1owLQYJKoZIhvcNAQk0MSAwHjANBglghkgBZQMEAgEFAKENBgkqhkiG9w0BAQsFADAvBgkqhkiG9w0BCQQxIgQgGF+NsyJx/iX1Yab8k4suJkMG7DBO2lGAB9F2SCY4GWkwgYYGCyqGSIb3DQEJEAIvMXcwdTBzMHEwDQYJYIZIAWUDBAIBBQAEIALz68oBYydCU7yAnSdJjdQbsDFtfmsGaWARXeFVWJ2cMD4wNKQyMDAxGzAZBgNVBAMMElJvb3RTZWxmU2lnbmVkRmFrZTERMA8GA1UECgwIRFNTLXRlc3QCBi7WFNe7VzANBgkqhkiG9w0BAQsFAAQEAQIDBA==",
  "name" : "RemoteDocument-signed-cades-baseline-b.pkcs7",
  "absolutePath" : "RemoteDocument",
  "mimeType" : {
    "mimeTypeString" : "application/pkcs7-signature"
  }
}

Extend document

The method allows to extend an existing signature to a stronger level.

Request
POST /services/rest/signature/one-document/extendDocument HTTP/1.1
Accept: application/json
Content-Type: application/json; charset=UTF-8
Host: localhost:8080
Content-Length: 7570

{
  "toExtendDocument" : {
    "bytes" : "PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48ZHM6U2lnbmF0dXJlIHhtbG5zOmRzPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwLzA5L3htbGRzaWcjIiBJZD0ia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U8L2RzOlg1MDlJc3N1ZXJOYW1lPjxkczpYNTA5U2VyaWFsTnVtYmVyPjIxNDUzNzExODMyOTQ1PC9kczpYNTA5U2VyaWFsTnVtYmVyPjwveGFkZXM6SXNzdWVyU2VyaWFsPjwveGFkZXM6Q2VydD48L3hhZGVzOlNpZ25pbmdDZXJ0aWZpY2F0ZT48L3hhZGVzOlNpZ25lZFNpZ25hdHVyZVByb3BlcnRpZXM+PHhhZGVzOlNpZ25lZERhdGFPYmplY3RQcm9wZXJ0aWVzPjx4YWRlczpEYXRhT2JqZWN0Rm9ybWF0IE9iamVjdFJlZmVyZW5jZT0iI3ItaWQtMSI+PHhhZGVzOk1pbWVUeXBlPnRleHQveG1sPC94YWRlczpNaW1lVHlwZT48L3hhZGVzOkRhdGFPYmplY3RGb3JtYXQ+PC94YWRlczpTaWduZWREYXRhT2JqZWN0UHJvcGVydGllcz48L3hhZGVzOlNpZ25lZFByb3BlcnRpZXM+PC94YWRlczpRdWFsaWZ5aW5nUHJvcGVydGllcz48L2RzOk9iamVjdD48L2RzOlNpZ25hdHVyZT4=",
    "name" : "xades-detached.xml",
    "absolutePath" : "RemoteDocument",
    "mimeType" : {
      "mimeTypeString" : "text/xml"
    }
  },
  "parameters" : {
    "signWithExpiredCertificate" : false,
    "signatureLevel" : "XAdES_BASELINE_T",
    "signaturePackaging" : null,
    "signatureAlgorithm" : "RSA_SHA256",
    "encryptionAlgorithm" : "RSA",
    "digestAlgorithm" : "SHA256",
    "signatureTimestampParameters" : {
      "digestAlgorithm" : "SHA256",
      "canonicalizationMethod" : "http://www.w3.org/2001/10/xml-exc-c14n#"
    },
    "archiveTimestampParameters" : {
      "digestAlgorithm" : "SHA256",
      "canonicalizationMethod" : "http://www.w3.org/2001/10/xml-exc-c14n#"
    },
    "contentTimestampParameters" : {
      "digestAlgorithm" : "SHA256",
      "canonicalizationMethod" : "http://www.w3.org/2001/10/xml-exc-c14n#"
    },
    "signingCertificate" : null,
    "certificateChain" : [ ],
    "detachedContents" : [ {
      "bytes" : "PGhlbGxvPndvcmxkPC9oZWxsbz4=",
      "name" : "sample.xml",
      "absolutePath" : "RemoteDocument",
      "mimeType" : {
        "mimeTypeString" : "text/xml"
      }
    } ],
    "asicContainerType" : null,
    "blevelParams" : {
      "trustAnchorBPPolicy" : true,
      "signingDate" : "2017-06-19T15:20:41.274Z",
      "claimedSignerRoles" : null,
      "certifiedSignerRoles" : null,
      "signaturePolicy" : null,
      "commitmentTypeIndications" : null,
      "signerLocation" : null
    }
  }
}
Response
HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Date: Mon, 19 Jun 2017 13:20:45 GMT
Content-Type: application/json
Transfer-Encoding: chunked
Content-Length: 16097

{
  "bytes" : "PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48ZHM6U2lnbmF0dXJlIHhtbG5zOmRzPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwLzA5L3htbGRzaWcjIiBJZD0iaWQtM2ZjZjYxNjQ2NTZmZDliOTNmMmRkYmQ4MWMxYzRiNGQiPjxkczpTaWduZWRJbmZvPjxkczpDYW5vbmljYWxpemF0aW9uTWV0aG9kIEFsZ29yaXRobT0iaHR0cDovL3d3dy53My5vcmcvMjAwMS8xMC94bWwtZXhjLWMxNG4jIi8+PGRzOlNpZ25hdHVyZU1ldGhvZCBBbGdvcml0aG09Imh0dHA6Ly93d3cudzMub3JnLzIwMDEvMDQveG1sZHNpZy1tb3JlI3JzYS1zaGEyNTYiLz48ZHM6UmVmZXJlbmNlIElkPSJyLWlkLTEiIFR5cGU9IiIgVVJJPSJzYW1wbGUueG1sIj48ZHM6RGlnZXN0TWV0aG9kIEFsZ29yaXRobT0iaHR0cDovL3d3dy53My5vcmcvMjAwMS8wNC94bWxlbmMjc2hhMjU2Ii8+PGRzOkRpZ2VzdFZhbHVlPmtjREhPWmp3WmhWZnVEaHVoQ2VDRVJSbVlwVEg0Smo0Um1mVlZpMzFROWc9PC9kczpEaWdlc3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YnNWV3Q5WWIreUlzSjY2RXFJc2VtOVRXWjJKbnFPN0Y2VlhVUUc1R0FidmNYclhNK1pObm1UeGhVVi9SSkFhNzNibXFkOWdaelJtVUpLV0hkb0xTOEk1OE9YTmx4Q2w3SnJmTHVGK3VxL2NhMC9FTXlQZGRiMUY5MWRvVGtPVlh6dE5PQ0dHbnI3V1VIakdZaWhFNjVMWC9zZzY0ZjdFa3ZINEdUcXNlMG1UUWN1MzZ5dmxMU2FuN1gvWUhlK0ZGSFRKeUFIcXp5Q29lSzU3VnRudk5jS3ZaQUFBQUFBPTwveGFkZXM6RW5jYXBzdWxhdGVkVGltZVN0YW1wPjwveGFkZXM6U2lnbmF0dXJlVGltZVN0YW1wPjwveGFkZXM6VW5zaWduZWRTaWduYXR1cmVQcm9wZXJ0aWVzPjwveGFkZXM6VW5zaWduZWRQcm9wZXJ0aWVzPjwveGFkZXM6UXVhbGlmeWluZ1Byb3BlcnRpZXM+PC9kczpPYmplY3Q+PC9kczpTaWduYXR1cmU+",
  "name" : "xades-detached-extended-xades-baseline-t.xml",
  "absolutePath" : "RemoteDocument",
  "mimeType" : {
    "mimeTypeString" : "text/xml"
  }
}

REST server signature service

This service also exposed 3 methods :

  • getKeys : retrieves available keys on server side

  • getKey : retrieves a key on the server side by its alias

  • sign : signs the digest value with the given key

Get keys

This method allows to retrieve all available keys on the server side (PKCS#11, PKCS#12, HSM,…​). All keys will have an alias, a signing certificate and its chain. The alias will be used in following steps.

Request
GET /services/rest/server-signing/keys HTTP/1.1
Accept: application/json
Host: localhost:8080
Response
HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Date: Mon, 19 Jun 2017 13:20:47 GMT
Content-Type: application/json
Transfer-Encoding: chunked
Content-Length: 2189

[ {
  "alias" : "certificate",
  "encryptionAlgo" : "RSA",
  "certificate" : {
    "encodedCertificate" : "MIIC6jCCAdKgAwIBAgIGLtYU17tXMA0GCSqGSIb3DQEBCwUAMDAxGzAZBgNVBAMMElJvb3RTZWxmU2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HhcNMTcwNjA4MTEyNjAxWhcNNDcwNzA0MDc1NzI0WjAoMRMwEQYDVQQDDApTaWduZXJGYWtlMREwDwYDVQQKDAhEU1MtdGVzdDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMI3kZhtnipn+iiZHZ9ax8FlfE5Ow/cFwBTfAEb3R1ZQUp6/BQnBt7Oo0JWBtc9qkv7JUDdcBJXPV5QWS5AyMPHpqQ75Hitjsq/Fzu8eHtkKpFizcxGa9BZdkQjh4rSrtO1Kjs0Rd5DQtWSgkeVCCN09kN0ZsZ0ENY+Ip8QxSmyztsStkYXdULqpwz4JEXW9vz64eTbde4vQJ6pjHGarJf1gQNEc2XzhmI/prXLysWNqC7lZg7PUZUTrdegABTUzYCRJ1kWBRPm4qo0LN405c94QQd45a5kTgowHzEgLnAQI28x0M3A59TKC+ieNc6VF1PsTLpUw7PNI2VstX5jAuasCAwEAAaMSMBAwDgYDVR0PAQH/BAQDAgEGMA0GCSqGSIb3DQEBCwUAA4IBAQCK6LGA01TR+rmU8p6yhAi4OkDN2b1dbIL8l8iCMYopLCxx8xqq3ubZCOxqh1X2j6pgWzarb0b/MUix00IoUvNbFOxAW7PBZIKDLnm6LsckRxs1U32sC9d1LOHe3WKBNB6GZALT1ewjh7hSbWjftlmcovq+6eVGA5cvf2u/2+TkKkyHV/NR394nXrdsdpvygwypEtXjetzD7UT93Nuw3xcV8VIftIvHf9LjU7h+UjGmKXG9c15eYr3SzUmv6kyOI0Bvw14PWtsWGl0QdOSRvIBBrP4adCnGTgjgjk9LTcO8B8FKrr+8lHGuc0bp4lIUToiUkGILXsiEeEg9WAqm+XqO"
  } ]
} ]

Get key

This method allows to retrieve key informations for a given alias.

Request
GET /services/rest/server-signing/key/certificate HTTP/1.1
Accept: application/json
Host: localhost:8080
Response
HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Date: Mon, 19 Jun 2017 13:20:46 GMT
Content-Type: application/json
Transfer-Encoding: chunked
Content-Length: 2185

{
  "alias" : "certificate",
  "encryptionAlgo" : "RSA",
  "certificate" : {
    "encodedCertificate" : "MIIC6jCCAdKgAwIBAgIGLtYU17tXMA0GCSqGSIb3DQEBCwUAMDAxGzAZBgNVBAMMElJvb3RTZWxmU2lnbmVkRmFrZTERMA8GA1UECgwIRFNTLXRlc3QwHhcNMTcwNjA4MTEyNjAxWhcNNDcwNzA0MDc1NzI0WjAoMRMwEQYDVQQDDApTaWduZXJGYWtlMREwDwYDVQQKDAhEU1MtdGVzdDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMI3kZhtnipn+iiZHZ9ax8FlfE5Ow/cFwBTfAEb3R1ZQUp6/BQnBt7Oo0JWBtc9qkv7JUDdcBJXPV5QWS5AyMPHpqQ75Hitjsq/Fzu8eHtkKpFizcxGa9BZdkQjh4rSrtO1Kjs0Rd5DQtWSgkeVCCN09kN0ZsZ0ENY+Ip8QxSmyztsStkYXdULqpwz4JEXW9vz64eTbde4vQJ6pjHGarJf1gQNEc2XzhmI/prXLysWNqC7lZg7PUZUTrdegABTUzYCRJ1kWBRPm4qo0LN405c94QQd45a5kTgowHzEgLnAQI28x0M3A59TKC+ieNc6VF1PsTLpUw7PNI2VstX5jAuasCAwEAAaMSMBAwDgYDVR0PAQH/BAQDAgEGMA0GCSqGSIb3DQEBCwUAA4IBAQCK6LGA01TR+rmU8p6yhAi4OkDN2b1dbIL8l8iCMYopLCxx8xqq3ubZCOxqh1X2j6pgWzarb0b/MUix00IoUvNbFOxAW7PBZIKDLnm6LsckRxs1U32sC9d1LOHe3WKBNB6GZALT1ewjh7hSbWjftlmcovq+6eVGA5cvf2u/2+TkKkyHV/NR394nXrdsdpvygwypEtXjetzD7UT93Nuw3xcV8VIftIvHf9LjU7h+UjGmKXG9c15eYr3SzUmv6kyOI0Bvw14PWtsWGl0QdOSRvIBBrP4adCnGTgjgjk9LTcO8B8FKrr+8lHGuc0bp4lIUToiUkGILXsiEeEg9WAqm+XqO"
  },
  "certificateChain" : [ {
    "encodedCertificate" : "MIIC6jCCAdKgAwIBAgIGLtYU17tXMA0GCSqGSIb3DQEBCwUAMDAxGzAZBgNVBAMMElJvb3RTZWxmU2lnbmVkRmFrZTERMA8GA1UECgwIRFNTLXRlc3QwHhcNMTcwNjA4MTEyNjAxWhcNNDcwNzA0MDc1NzI0WjAoMRMwEQYDVQQDDApTaWduZXJGYWtlMREwDwYDVQQKDAhEU1MtdGVzdDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMI3kZhtnipn+iiZHZ9ax8FlfE5Ow/cFwBTfAEb3R1ZQUp6/BQnBt7Oo0JWBtc9qkv7JUDdcBJXPV5QWS5AyMPHpqQ75Hitjsq/Fzu8eHtkKpFizcxGa9BZdkQjh4rSrtO1Kjs0Rd5DQtWSgkeVCCN09kN0ZsZ0ENY+Ip8QxSmyztsStkYXdULqpwz4JEXW9vz64eTbde4vQJ6pjHGarJf1gQNEc2XzhmI/prXLysWNqC7lZg7PUZUTrdegABTUzYCRJ1kWBRPm4qo0LN405c94QQd45a5kTgowHzEgLnAQI28x0M3A59TKC+ieNc6VF1PsTLpUw7PNI2VstX5jAuasCAwEAAaMSMBAwDgYDVR0PAQH/BAQDAgEGMA0GCSqGSIb3DQEBCwUAA4IBAQCK6LGA01TR+rmU8p6yhAi4OkDN2b1dbIL8l8iCMYopLCxx8xqq3ubZCOxqh1X2j6pgWzarb0b/MUix00IoUvNbFOxAW7PBZIKDLnm6LsckRxs1U32sC9d1LOHe3WKBNB6GZALT1ewjh7hSbWjftlmcovq+6eVGA5cvf2u/2+TkKkyHV/NR394nXrdsdpvygwypEtXjetzD7UT93Nuw3xcV8VIftIvHf9LjU7h+UjGmKXG9c15eYr3SzUmv6kyOI0Bvw14PWtsWGl0QdOSRvIBBrP4adCnGTgjgjk9LTcO8B8FKrr+8lHGuc0bp4lIUToiUkGILXsiEeEg9WAqm+XqO"
  } ]
}

Sign

This method allows to sign the given digest with a server side certificate.

Request
POST /services/rest/server-signing/sign/certificate/SHA256 HTTP/1.1
Accept: application/json
Content-Type: application/json; charset=UTF-8
Host: localhost:8080
Content-Length: 64

{
  "bytes" : "wFNeS+K3n/2TKRMFQ2v4iTFOSj+uwF7P/Lt98xrZ5Ro="
}
Response
HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Date: Mon, 19 Jun 2017 13:20:47 GMT
Content-Type: application/json
Transfer-Encoding: chunked
Content-Length: 395

{
  "algorithm" : "RSA_SHA256",
  "value" : "CbMjTmDXOOYju1szaY3iqO5+XWgx2KVOUvpvQUi4gYBAQNiRpnyWDBn2KuNEByZ5Iqe5qms0IT71dnxukvzeBSR9gktEjhX9UjBKYrM1Z/lVoTb6/FuXX3uc9BFFkNtSmu0PIWgTWr3sBbtswXlDHX8b86PeCXSsDpLv2A8LK1WwJf078stErMy9wtk9d5Vts5UuDKHk7plTbyhrBcL8XW+K/hR5NUwG3dP/nR5Y8U0bYa2NSUyBbgzK1+2JcOVnAwSic074iUyY/c756W3XWjhrHnoBfs9hRERVFvEeroAyicYsAHTb7mB/HCou32hmQ0Hye4PpNhywx76zXVw56Q=="
}

REST validation service

This service allows to validate signature (all formats/types) against a validation policy.

Request
POST /services/rest/validation/validateSignature HTTP/1.1
Accept: application/json
Content-Type: application/json; charset=UTF-8
Host: localhost:8080
Content-Length: 6431

{
  "signedDocument" : {
    "bytes" : "PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48ZHM6U2lnbmF0dXJlIHhtbG5zOmRzPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwLzA5L3htbGRzaWcjIiBJZD0iaWQtM2ZjZjYxNjQ2NTZmZDliOTNmMmRkYmQ4MWMxYzRiNGQiPjxkczpTaWduZWRJbmZvPjxkczpDYW5vbmljYWxpemF0aW9uTWV0aG9kIEFsZ29yaXRobT0iaHR0cDovL3d3dy53My5vcmcvMjAwMS8xMC94bWwtZXhjLWMxNG4jIi8+PGRzOlNpZ25hdHVyZU1ldGhvZCBB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25lZFNpZ25hdHVyZVByb3BlcnRpZXM+PHhhZGVzOlNpZ25lZERhdGFPYmplY3RQcm9wZXJ0aWVzPjx4YWRlczpEYXRhT2JqZWN0Rm9ybWF0IE9iamVjdFJlZmVyZW5jZT0iI3ItaWQtMSI+PHhhZGVzOk1pbWVUeXBlPnRleHQveG1sPC94YWRlczpNaW1lVHlwZT48L3hhZGVzOkRhdGFPYmplY3RGb3JtYXQ+PC94YWRlczpTaWduZWREYXRhT2JqZWN0UHJvcGVydGllcz48L3hhZGVzOlNpZ25lZFByb3BlcnRpZXM+PC94YWRlczpRdWFsaWZ5aW5nUHJvcGVydGllcz48L2RzOk9iamVjdD48L2RzOlNpZ25hdHVyZT4=",
    "name" : "xades-detached.xml",
    "absolutePath" : "RemoteDocument",
    "mimeType" : {
      "mimeTypeString" : "text/xml"
    }
  },
  "originalDocument" : {
    "bytes" : "PGhlbGxvPndvcmxkPC9oZWxsbz4=",
    "name" : "sample.xml",
    "absolutePath" : "RemoteDocument",
    "mimeType" : {
      "mimeTypeString" : "text/xml"
    }
  },
  "policy" : null
}
Response
HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Date: Mon, 19 Jun 2017 13:20:46 GMT
Content-Type: application/json
Transfer-Encoding: chunked
Content-Length: 32562

{
  "diagnosticData" : {
    "documentName" : "xades-detached.xml",
    "validationDate" : 1497878446287,
    "containerInfo" : null,
    "signatures" : [ {
      "signatureFilename" : "xades-detached.xml",
      "parentId" : null,
      "errorMessage" : null,
      "dateTime" : 1453711832000,
      "signatureFormat" : "XAdES-BASELINE-B",
      "structuralValidation" : {
        "valid" : true,
        "message" : null
      },
      "basicSignature" : {
        "encryptionAlgoUsedToSignThisToken" : "RSA",
        "keyLengthUsedToSignThisToken" : "2048",
        "digestAlgoUsedToSignThisToken" : "SHA256",
        "referenceDataFound" : true,
        "referenceDataIntact" : false,
        "signatureIntact" : false,
        "signatureValid" : false
      },
      "signingCertificate" : {
        "attributePresent" : true,
        "digestValuePresent" : true,
        "digestValueMatch" : true,
        "issuerSerialMatch" : true,
        "signed" : null,
        "id" : "3FFFFA6CC665DFB97E9A34F9CA62DB5EB441EC9F16A8667A7B6BCAB734DCCFFE"
      },
      "certificateChain" : [ {
        "source" : "SIGNATURE",
        "id" : "3FFFFA6CC665DFB97E9A34F9CA62DB5EB441EC9F16A8667A7B6BCAB734DCCFFE"
      }, {
        "source" : "SIGNATURE",
        "id" : "AD3620F1A826B491379CD45C3210914FCE7BEC18E2824BDDD7B171355BFA8FC7"
      } ],
      "contentType" : "text/xml",
      "contentIdentifier" : null,
      "contentHints" : null,
      "signatureProductionPlace" : null,
      "commitmentTypeIndication" : [ ],
      "claimedRoles" : [ ],
      "certifiedRoles" : [ ],
      "policy" : null,
      "timestamps" : [ ],
      "signatureScopes" : [ {
        "value" : "Full document",
        "name" : "sample.xml",
        "scope" : "FullSignatureScope"
      } ],
      "id" : "id-3fcf6164656fd9b93f2ddbd81c1c4b4d",
      "type" : null
    } ],
    "usedCertificates" : [ {
      "subjectDistinguishedName" : [ {
        "value" : "o=dss-test,cn=rootselfsignedfake",
        "format" : "CANONICAL"
      }, {
        "value" : "O=DSS-test,CN=RootSelfSignedFake",
        "format" : "RFC2253"
      } ],
      "issuerDistinguishedName" : [ {
        "value" : "o=dss-test,cn=rootselfsignedfake",
        "format" : "CANONICAL"
      }, {
        "value" : "O=DSS-test,CN=RootSelfSignedFake",
        "format" : "RFC2253"
      } ],
      "serialNumber" : 11453711832535,
      "commonName" : "RootSelfSignedFake",
      "countryName" : null,
      "organizationName" : "DSS-test",
      "givenName" : null,
      "organizationalUnit" : null,
      "surname" : null,
      "pseudonym" : null,
      "authorityInformationAccessUrls" : [ ],
      "digestAlgoAndValues" : [ ],
      "notAfter" : 1454575832000,
      "notBefore" : 1453625432000,
      "publicKeySize" : 2048,
      "publicKeyEncryptionAlgo" : "RSA",
      "keyUsageBits" : [ "keyCertSign", "crlSign" ],
      "idKpOCSPSigning" : false,
      "idPkixOcspNoCheck" : false,
      "basicSignature" : {
        "encryptionAlgoUsedToSignThisToken" : "RSA",
        "keyLengthUsedToSignThisToken" : "2048",
        "digestAlgoUsedToSignThisToken" : "SHA256",
        "referenceDataFound" : true,
        "referenceDataIntact" : true,
        "signatureIntact" : true,
        "signatureValid" : true
      },
      "signingCertificate" : null,
      "certificateChain" : [ ],
      "trusted" : false,
      "selfSigned" : true,
      "certificatePolicyIds" : [ ],
      "trustedServiceProviders" : [ ],
      "revocations" : [ ],
      "info" : [ ],
      "base64Encoded" : "TUlJQzhqQ0NBZHFnQXdJQkFnSUdDbXJHYk5YWE1BMEdDU3FHU0liM0RRRUJDd1VBTURBeEd6QVpCZ05WQkFNTUVsSnZiM1JUWld4bVUybG5ibVZrUm1GclpURVJNQThHQTFVRUNnd0lSRk5UTFhSbGMzUXdIaGNOTVRZd01USTBNRGcxTURNeVdoY05NVFl3TWpBME1EZzFNRE15V2pBd01Sc3dHUVlEVlFRRERCSlNiMjkwVTJWc1psTnBaMjVsWkVaaGEyVXhFVEFQQmdOVkJBb01DRVJUVXkxMFpYTjBNSUlCSWpBTkJna3Foa2lHOXcwQkFRRUZBQU9DQVE4QU1JSUJDZ0tDQVFFQXBybVgvWGFQQlhXeEtaZzNFTmhCVUZWcXpRUmM2dEQ5S0grSjV3R0FGbHpVczZmd3ZEUHBFV2Q4WE1QUmhpRFN0L01xdnBjNmdmaStVK3l1amhxUEhUcWoyRFUyc2pKVnNHamk4OUMzMEFqVzRDd0Z1SjJIZ2pNdnIvb0VqYVd0SFV4a2drdVpKSkN5WmM2RlEwM0hvMVBRZ21KUFpVWjc3ckxTcGx5NGlzdUlSRVBzRzc5dEZOVjRRdC9zMkhaSmZUZm5jcjBPV1F2U1dSTEUyTmZQamMxeUI3NVQwSHQ3WnFZNXhscm5QeGFPTzNVdk5FY2pnbEFKcFlKRlh0bkVDMDUyRmlnUWpaK083Ty81Y2hXUGJWWFhYTFpOWlFqcmg2LzdmQ1NJTmxoemZiRU1oUUpWKzRJTEE4UWlwUm9kYTltSEZNK3JNUDBCUDloWnVtUjJtUUlEQVFBQm94SXdFREFPQmdOVkhROEJBZjhFQkFNQ0FRWXdEUVlKS29aSWh2Y05BUUVMQlFBRGdnRUJBQzUwSHlOWGNkWGk5VDJIYVBiUHFmdmV5cnVxbjRCQXFITVJhS2ZYTDN4eUZJZkNiRDNla2p3cFRYRkRTblZoZWQ2RThrVGE5ZDJpM1lEcncrcUYvbGZReW4xQ0hza0xyOFFkWmR0Y1hyazdKWkR0WEl6YWJuUDJmV3ladnYvcDlDTEQzTXBjcnFwbUg0ZWdpNktpZmRTOForZ1o2WjZxR1BLZ21TNXJKeE9uRVU0RGhIbkw4c3RHL1JUejN2YVl5RU9CZXlVUyt6bDRsYURCajZjcGhRQnFuVWVFaGhqeVo4RVVpSVY0ak1Jd3JBdkxGWTMvV1JGMStwZ0p4ZVlmRDhqLzRES2FQSEpydDJoQVQ0ditSck8xblFreVl3QmFGTk1IeExDcGtxV0hVQUZIOGFEU3lsZ0RlUk82TFM4YXI4RnZVYXBReUhnaFNKdmFjRHFuZXVZPQ==",
      "id" : "AD3620F1A826B491379CD45C3210914FCE7BEC18E2824BDDD7B171355BFA8FC7",
      "qctypes" : [ ],
      "qcstatementIds" : [ ],
      "crldistributionPoints" : [ ],
      "ocspaccessUrls" : [ ]
    }, {
      "subjectDistinguishedName" : [ {
        "value" : "o=dss-test,cn=signerfake",
        "format" : "CANONICAL"
      }, {
        "value" : "O=DSS-test,CN=SignerFake",
        "format" : "RFC2253"
      } ],
      "issuerDistinguishedName" : [ {
        "value" : "o=dss-test,cn=rootselfsignedfake",
        "format" : "CANONICAL"
      }, {
        "value" : "O=DSS-test,CN=RootSelfSignedFake",
        "format" : "RFC2253"
      } ],
      "serialNumber" : 21453711832945,
      "commonName" : "SignerFake",
      "countryName" : null,
      "organizationName" : "DSS-test",
      "givenName" : null,
      "organizationalUnit" : null,
      "surname" : null,
      "pseudonym" : null,
      "authorityInformationAccessUrls" : [ ],
      "digestAlgoAndValues" : [ ],
      "notAfter" : 1454575832000,
      "notBefore" : 1453625432000,
      "publicKeySize" : 2048,
      "publicKeyEncryptionAlgo" : "RSA",
      "keyUsageBits" : [ "keyCertSign", "crlSign" ],
      "idKpOCSPSigning" : false,
      "idPkixOcspNoCheck" : false,
      "basicSignature" : {
        "encryptionAlgoUsedToSignThisToken" : "RSA",
        "keyLengthUsedToSignThisToken" : "2048",
        "digestAlgoUsedToSignThisToken" : "SHA256",
        "referenceDataFound" : true,
        "referenceDataIntact" : true,
        "signatureIntact" : true,
        "signatureValid" : true
      },
      "signingCertificate" : {
        "attributePresent" : null,
        "digestValuePresent" : null,
        "digestValueMatch" : null,
        "issuerSerialMatch" : null,
        "signed" : null,
        "id" : "AD3620F1A826B491379CD45C3210914FCE7BEC18E2824BDDD7B171355BFA8FC7"
      },
      "certificateChain" : [ {
        "source" : "SIGNATURE",
        "id" : "AD3620F1A826B491379CD45C3210914FCE7BEC18E2824BDDD7B171355BFA8FC7"
      } ],
      "trusted" : false,
      "selfSigned" : false,
      "certificatePolicyIds" : [ ],
      "trustedServiceProviders" : [ ],
      "revocations" : [ ],
      "info" : [ {
        "value" : "No CRL info found !",
        "id" : 0
      }, {
        "value" : "OSCP Uri not found in certificate meta-data !",
        "id" : 1
      }, {
        "value" : "No CRL info found !",
        "id" : 2
      } ],
      "base64Encoded" : "TUlJQzZqQ0NBZEtnQXdJQkFnSUdFNE1VMzNkeE1BMEdDU3FHU0liM0RRRUJDd1VBTURBeEd6QVpCZ05WQkFNTUVsSnZiM1JUWld4bVUybG5ibVZrUm1GclpURVJNQThHQTFVRUNnd0lSRk5UTFhSbGMzUXdIaGNOTVRZd01USTBNRGcxTURNeVdoY05NVFl3TWpBME1EZzFNRE15V2pBb01STXdFUVlEVlFRRERBcFRhV2R1WlhKR1lXdGxNUkV3RHdZRFZRUUtEQWhFVTFNdGRHVnpkRENDQVNJd0RRWUpLb1pJaHZjTkFRRUJCUUFEZ2dFUEFEQ0NBUW9DZ2dFQkFKY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",
      "qctypes" : [ ],
      "qcstatementIds" : [ ],
      "crldistributionPoints" : [ ],
      "ocspaccessUrls" : [ ]
    } ],
    "trustedLists" : [ ],
    "listOfTrustedLists" : null
  },
  "simpleReport" : {
    "policy" : {
      "policyName" : "QES AdESQC TL based",
      "policyDescription" : "Validate electronic signatures and indicates whether they are Advanced electronic Signatures (AdES), AdES supported by a Qualified Certificate (AdES/QC) or a\n\t\tQualified electronic Signature (QES). All certificates and their related chains supporting the signatures are validated against the EU Member State Trusted Lists (this includes\n\t\tsigner's certificate and certificates used to validate certificate validity status services - CRLs, OCSP, and time-stamps).\n\t"
    },
    "validationTime" : 1497878446287,
    "documentName" : "xades-detached.xml",
    "validSignaturesCount" : 0,
    "signaturesCount" : 1,
    "containerType" : null,
    "signature" : [ {
      "filename" : null,
      "signingTime" : 1453711832000,
      "signedBy" : "SignerFake",
      "certificateChain" : {
        "certificate" : [ {
          "id" : "3FFFFA6CC665DFB97E9A34F9CA62DB5EB441EC9F16A8667A7B6BCAB734DCCFFE",
          "qualifiedName" : "SignerFake"
        }, {
          "id" : "AD3620F1A826B491379CD45C3210914FCE7BEC18E2824BDDD7B171355BFA8FC7",
          "qualifiedName" : "RootSelfSignedFake"
        } ]
      },
      "signatureLevel" : {
        "value" : "NA",
        "description" : "Not applicable"
      },
      "indication" : "TOTAL_FAILED",
      "subIndication" : "HASH_FAILURE",
      "errors" : [ "The certificate path is not trusted!", "The reference data object(s) is not intact!" ],
      "warnings" : [ "Authority info access is not present!", "The signature/seal is not a valid AdES!", "Revocation info access is not present!", "The signer's certificate has not expected key-usage!" ],
      "infos" : [ ],
      "signatureScope" : [ {
        "value" : "Full document",
        "name" : "sample.xml",
        "scope" : "FullSignatureScope"
      } ],
      "id" : "id-3fcf6164656fd9b93f2ddbd81c1c4b4d",
      "type" : null,
      "parentId" : null,
      "signatureFormat" : "XAdES-BASELINE-B"
    } ]
  },
  "detailedReport" : {
    "signatures" : [ {
      "validationProcessBasicSignatures" : {
        "constraint" : [ {
          "name" : {
            "value" : "Is the result of the Basic Validation Process conclusive?",
            "nameId" : "ADEST_ROBVPIIC"
          },
          "status" : "NOT_OK",
          "error" : {
            "value" : "The result of the Basic validation process is not conclusive!",
            "nameId" : "ADEST_ROBVPIIC_ANS"
          },
          "warning" : null,
          "info" : null,
          "additionalInfo" : null,
          "id" : "id-3fcf6164656fd9b93f2ddbd81c1c4b4d"
        } ],
        "conclusion" : {
          "indication" : "FAILED",
          "subIndication" : "HASH_FAILURE",
          "errors" : [ {
            "value" : "The reference data object(s) is not intact!",
            "nameId" : "BBB_CV_IRDOI_ANS"
          } ],
          "warnings" : [ ],
          "infos" : [ ]
        }
      },
      "validationProcessTimestamps" : [ ],
      "validationProcessLongTermData" : {
        "constraint" : [ {
          "name" : {
            "value" : "Is the result of the Basic Validation Process acceptable?",
            "nameId" : "LTV_ABSV"
          },
          "status" : "NOT_OK",
          "error" : {
            "value" : "The result of the Basic validation process is not acceptable to continue the process!",
            "nameId" : "LTV_ABSV_ANS"
          },
          "warning" : null,
          "info" : null,
          "additionalInfo" : null,
          "id" : null
        } ],
        "conclusion" : {
          "indication" : "FAILED",
          "subIndication" : "HASH_FAILURE",
          "errors" : [ {
            "value" : "The reference data object(s) is not intact!",
            "nameId" : "BBB_CV_IRDOI_ANS"
          } ],
          "warnings" : [ ],
          "infos" : [ ]
        }
      },
      "validationProcessArchivalData" : {
        "constraint" : [ {
          "name" : {
            "value" : "Is the result of the LTV validation process acceptable?",
            "nameId" : "ARCH_LTVV"
          },
          "status" : "NOT_OK",
          "error" : {
            "value" : "The result of the LTV validation process is not acceptable to continue the process!",
            "nameId" : "ARCH_LTVV_ANS"
          },
          "warning" : null,
          "info" : null,
          "additionalInfo" : null,
          "id" : null
        } ],
        "conclusion" : {
          "indication" : "FAILED",
          "subIndication" : "HASH_FAILURE",
          "errors" : [ {
            "value" : "The reference data object(s) is not intact!",
            "nameId" : "BBB_CV_IRDOI_ANS"
          } ],
          "warnings" : [ ],
          "infos" : [ ]
        }
      },
      "id" : "id-3fcf6164656fd9b93f2ddbd81c1c4b4d",
      "type" : null
    } ],
    "basicBuildingBlocks" : [ {
      "fc" : {
        "constraint" : [ {
          "name" : {
            "value" : "Is the expected format found?",
            "nameId" : "BBB_FC_IEFF"
          },
          "status" : "OK",
          "error" : null,
          "warning" : null,
          "info" : null,
          "additionalInfo" : null,
          "id" : null
        } ],
        "conclusion" : {
          "indication" : "PASSED",
          "subIndication" : null,
          "errors" : [ ],
          "warnings" : [ ],
          "infos" : [ ]
        }
      },
      "isc" : {
        "constraint" : [ {
          "name" : {
            "value" : "Is there an identified candidate for the signing certificate?",
            "nameId" : "BBB_ICS_ISCI"
          },
          "status" : "OK",
          "error" : null,
          "warning" : null,
          "info" : null,
          "additionalInfo" : null,
          "id" : null
        }, {
          "name" : {
            "value" : "Is the signing certificate signed?",
            "nameId" : "BBB_ICS_ISCS"
          },
          "status" : "OK",
          "error" : null,
          "warning" : null,
          "info" : null,
          "additionalInfo" : null,
          "id" : null
        }, {
          "name" : {
            "value" : "Is the signed attribute: 'signing-certificate' present?",
            "nameId" : "BBB_ICS_ISASCP"
          },
          "status" : "OK",
          "error" : null,
          "warning" : null,
          "info" : null,
          "additionalInfo" : null,
          "id" : null
        }, {
          "name" : {
            "value" : "Is the signed attribute: 'cert-digest' of the certificate present?",
            "nameId" : "BBB_ICS_ISACDP"
          },
          "status" : "OK",
          "error" : null,
          "warning" : null,
          "info" : null,
          "additionalInfo" : null,
          "id" : null
        }, {
          "name" : {
            "value" : "Is the certificate's digest value valid?",
            "nameId" : "BBB_ICS_ICDVV"
          },
          "status" : "OK",
          "error" : null,
          "warning" : null,
          "info" : null,
          "additionalInfo" : null,
          "id" : null
        }, {
          "name" : {
            "value" : "Are the issuer distinguished name and the serial number equal?",
            "nameId" : "BBB_ICS_AIDNASNE"
          },
          "status" : "OK",
          "error" : null,
          "warning" : null,
          "info" : null,
          "additionalInfo" : null,
          "id" : null
        } ],
        "conclusion" : {
          "indication" : "PASSED",
          "subIndication" : null,
          "errors" : [ ],
          "warnings" : [ ],
          "infos" : [ ]
        },
        "certificateChain" : {
          "chainItem" : [ {
            "source" : "SIGNATURE",
            "id" : "3FFFFA6CC665DFB97E9A34F9CA62DB5EB441EC9F16A8667A7B6BCAB734DCCFFE"
          }, {
            "source" : "SIGNATURE",
            "id" : "AD3620F1A826B491379CD45C3210914FCE7BEC18E2824BDDD7B171355BFA8FC7"
          } ]
        }
      },
      "vci" : {
        "constraint" : [ {
          "name" : {
            "value" : "Is the signature policy known?",
            "nameId" : "BBB_VCI_ISPK"
          },
          "status" : "OK",
          "error" : null,
          "warning" : null,
          "info" : null,
          "additionalInfo" : null,
          "id" : null
        } ],
        "conclusion" : {
          "indication" : "PASSED",
          "subIndication" : null,
          "errors" : [ ],
          "warnings" : [ ],
          "infos" : [ ]
        }
      },
      "cv" : {
        "constraint" : [ {
          "name" : {
            "value" : "Is the reference data object(s) found?",
            "nameId" : "BBB_CV_IRDOF"
          },
          "status" : "OK",
          "error" : null,
          "warning" : null,
          "info" : null,
          "additionalInfo" : null,
          "id" : null
        }, {
          "name" : {
            "value" : "Is the reference data object(s) intact?",
            "nameId" : "BBB_CV_IRDOI"
          },
          "status" : "NOT_OK",
          "error" : {
            "value" : "The reference data object(s) is not intact!",
            "nameId" : "BBB_CV_IRDOI_ANS"
          },
          "warning" : null,
          "info" : null,
          "additionalInfo" : null,
          "id" : null
        } ],
        "conclusion" : {
          "indication" : "FAILED",
          "subIndication" : "HASH_FAILURE",
          "errors" : [ {
            "value" : "The reference data object(s) is not intact!",
            "nameId" : "BBB_CV_IRDOI_ANS"
          } ],
          "warnings" : [ ],
          "infos" : [ ]
        }
      },
      "sav" : {
        "constraint" : [ {
          "name" : {
            "value" : "Is signed qualifying property: 'signing-time' present?",
            "nameId" : "BBB_SAV_ISQPSTP"
          },
          "status" : "OK",
          "error" : null,
          "warning" : null,
          "info" : null,
          "additionalInfo" : null,
          "id" : null
        }, {
          "name" : {
            "value" : "Are signature cryptographic constraints met?",
            "nameId" : "ASCCM"
          },
          "status" : "OK",
          "error" : null,
          "warning" : null,
          "info" : null,
          "additionalInfo" : "Validation time : 2017-06-19 15:20",
          "id" : null
        } ],
        "conclusion" : {
          "indication" : "PASSED",
          "subIndication" : null,
          "errors" : [ ],
          "warnings" : [ ],
          "infos" : [ ]
        }
      },
      "xcv" : {
        "constraint" : [ {
          "name" : {
            "value" : "Can the certificate chain be built till the trust anchor?",
            "nameId" : "BBB_XCV_CCCBB"
          },
          "status" : "NOT_OK",
          "error" : {
            "value" : "The certificate chain for signature is not trusted, there is no trusted anchor.",
            "nameId" : "BBB_XCV_CCCBB_SIG_ANS"
          },
          "warning" : null,
          "info" : null,
          "additionalInfo" : null,
          "id" : null
        } ],
        "conclusion" : {
          "indication" : "INDETERMINATE",
          "subIndication" : "NO_CERTIFICATE_CHAIN_FOUND",
          "errors" : [ {
            "value" : "The certificate chain for signature is not trusted, there is no trusted anchor.",
            "nameId" : "BBB_XCV_CCCBB_SIG_ANS"
          } ],
          "warnings" : [ ],
          "infos" : [ ]
        },
        "subXCV" : [ {
          "constraint" : [ {
            "name" : {
              "value" : "Is the certificate unique ?",
              "nameId" : "QUAL_UNIQUE_CERT"
            },
            "status" : "OK",
            "error" : null,
            "warning" : null,
            "info" : null,
            "additionalInfo" : null,
            "id" : null
          }, {
            "name" : {
              "value" : "Is the certificate's signature intact?",
              "nameId" : "BBB_XCV_ICSI"
            },
            "status" : "OK",
            "error" : null,
            "warning" : null,
            "info" : null,
            "additionalInfo" : null,
            "id" : null
          }, {
            "name" : {
              "value" : "Are signature cryptographic constraints met?",
              "nameId" : "ASCCM"
            },
            "status" : "OK",
            "error" : null,
            "warning" : null,
            "info" : null,
            "additionalInfo" : "Validation time : 2017-06-19 15:20",
            "id" : null
          }, {
            "name" : {
              "value" : "Has the signer's certificate given key-usage?",
              "nameId" : "BBB_XCV_ISCGKU"
            },
            "status" : "WARNING",
            "error" : null,
            "warning" : {
              "value" : "The signer's certificate has not expected key-usage!",
              "nameId" : "BBB_XCV_ISCGKU_ANS"
            },
            "info" : null,
            "additionalInfo" : "Key usage : keyCertSign, crlSign",
            "id" : null
          }, {
            "name" : {
              "value" : "Is authority info access present?",
              "nameId" : "BBB_XCV_AIA_PRES"
            },
            "status" : "WARNING",
            "error" : null,
            "warning" : {
              "value" : "Authority info access is not present!",
              "nameId" : "BBB_XCV_AIA_PRES_ANS"
            },
            "info" : null,
            "additionalInfo" : null,
            "id" : null
          }, {
            "name" : {
              "value" : "Is revocation info access present?",
              "nameId" : "BBB_XCV_REVOC_PRES"
            },
            "status" : "WARNING",
            "error" : null,
            "warning" : {
              "value" : "Revocation info access is not present!",
              "nameId" : "BBB_XCV_REVOC_PRES_ANS"
            },
            "info" : null,
            "additionalInfo" : null,
            "id" : null
          }, {
            "name" : {
              "value" : "Is the certificate not revoked?",
              "nameId" : "BBB_XCV_ISCR"
            },
            "status" : "OK",
            "error" : null,
            "warning" : null,
            "info" : null,
            "additionalInfo" : null,
            "id" : null
          }, {
            "name" : {
              "value" : "Is the certificate on hold?",
              "nameId" : "BBB_XCV_ISCOH"
            },
            "status" : "OK",
            "error" : null,
            "warning" : null,
            "info" : null,
            "additionalInfo" : null,
            "id" : null
          }, {
            "name" : {
              "value" : "Is the current time in the validity range of the signer's certificate?",
              "nameId" : "BBB_XCV_ICTIVRSC"
            },
            "status" : "NOT_OK",
            "error" : {
              "value" : "The current time is not in the validity range of the signer's certificate.",
              "nameId" : "BBB_XCV_ICTIVRSC_ANS"
            },
            "warning" : null,
            "info" : null,
            "additionalInfo" : "Certificate validity : 2016-01-24 09:50 to 2016-02-04 09:50",
            "id" : null
          } ],
          "conclusion" : {
            "indication" : "INDETERMINATE",
            "subIndication" : "OUT_OF_BOUNDS_NO_POE",
            "errors" : [ {
              "value" : "The current time is not in the validity range of the signer's certificate.",
              "nameId" : "BBB_XCV_ICTIVRSC_ANS"
            } ],
            "warnings" : [ ],
            "infos" : [ ]
          },
          "rfc" : {
            "constraint" : [ {
              "name" : {
                "value" : "Is the revocation data present for the certificate?",
                "nameId" : "BBB_XCV_IRDPFC"
              },
              "status" : "NOT_OK",
              "error" : {
                "value" : "No revocation data for the certificate",
                "nameId" : "BBB_XCV_IRDPFC_ANS"
              },
              "warning" : null,
              "info" : null,
              "additionalInfo" : null,
              "id" : null
            } ],
            "conclusion" : {
              "indication" : "INDETERMINATE",
              "subIndication" : "TRY_LATER",
              "errors" : [ {
                "value" : "No revocation data for the certificate",
                "nameId" : "BBB_XCV_IRDPFC_ANS"
              } ],
              "warnings" : [ ],
              "infos" : [ ]
            }
          },
          "id" : "3FFFFA6CC665DFB97E9A34F9CA62DB5EB441EC9F16A8667A7B6BCAB734DCCFFE",
          "trustAnchor" : false
        }, {
          "constraint" : [ {
            "name" : {
              "value" : "Is the certificate's signature intact?",
              "nameId" : "BBB_XCV_ICSI"
            },
            "status" : "OK",
            "error" : null,
            "warning" : null,
            "info" : null,
            "additionalInfo" : null,
            "id" : null
          }, {
            "name" : {
              "value" : "Are signature cryptographic constraints met?",
              "nameId" : "ASCCM"
            },
            "status" : "OK",
            "error" : null,
            "warning" : null,
            "info" : null,
            "additionalInfo" : "Validation time : 2017-06-19 15:20",
            "id" : null
          }, {
            "name" : {
              "value" : "Is the certificate not revoked?",
              "nameId" : "BBB_XCV_ISCR"
            },
            "status" : "OK",
            "error" : null,
            "warning" : null,
            "info" : null,
            "additionalInfo" : null,
            "id" : null
          }, {
            "name" : {
              "value" : "Is the certificate on hold?",
              "nameId" : "BBB_XCV_ISCOH"
            },
            "status" : "OK",
            "error" : null,
            "warning" : null,
            "info" : null,
            "additionalInfo" : null,
            "id" : null
          }, {
            "name" : {
              "value" : "Is the current time in the validity range of the signer's certificate?",
              "nameId" : "BBB_XCV_ICTIVRSC"
            },
            "status" : "NOT_OK",
            "error" : {
              "value" : "The current time is not in the validity range of the signer's certificate.",
              "nameId" : "BBB_XCV_ICTIVRSC_ANS"
            },
            "warning" : null,
            "info" : null,
            "additionalInfo" : "Certificate validity : 2016-01-24 09:50 to 2016-02-04 09:50",
            "id" : null
          } ],
          "conclusion" : {
            "indication" : "INDETERMINATE",
            "subIndication" : "OUT_OF_BOUNDS_NO_POE",
            "errors" : [ {
              "value" : "The current time is not in the validity range of the signer's certificate.",
              "nameId" : "BBB_XCV_ICTIVRSC_ANS"
            } ],
            "warnings" : [ ],
            "infos" : [ ]
          },
          "rfc" : {
            "constraint" : [ {
              "name" : {
                "value" : "Is the revocation data present for the certificate?",
                "nameId" : "BBB_XCV_IRDPFC"
              },
              "status" : "NOT_OK",
              "error" : {
                "value" : "No revocation data for the certificate",
                "nameId" : "BBB_XCV_IRDPFC_ANS"
              },
              "warning" : null,
              "info" : null,
              "additionalInfo" : null,
              "id" : null
            } ],
            "conclusion" : {
              "indication" : "INDETERMINATE",
              "subIndication" : "TRY_LATER",
              "errors" : [ {
                "value" : "No revocation data for the certificate",
                "nameId" : "BBB_XCV_IRDPFC_ANS"
              } ],
              "warnings" : [ ],
              "infos" : [ ]
            }
          },
          "id" : "AD3620F1A826B491379CD45C3210914FCE7BEC18E2824BDDD7B171355BFA8FC7",
          "trustAnchor" : false
        } ]
      },
      "psv" : null,
      "pcv" : null,
      "vts" : null,
      "certificateChain" : {
        "chainItem" : [ {
          "source" : "SIGNATURE",
          "id" : "3FFFFA6CC665DFB97E9A34F9CA62DB5EB441EC9F16A8667A7B6BCAB734DCCFFE"
        }, {
          "source" : "SIGNATURE",
          "id" : "AD3620F1A826B491379CD45C3210914FCE7BEC18E2824BDDD7B171355BFA8FC7"
        } ]
      },
      "conclusion" : {
        "indication" : "FAILED",
        "subIndication" : "HASH_FAILURE",
        "errors" : [ {
          "value" : "The certificate chain for signature is not trusted, there is no trusted anchor.",
          "nameId" : "BBB_XCV_CCCBB_SIG_ANS"
        }, {
          "value" : "The reference data object(s) is not intact!",
          "nameId" : "BBB_CV_IRDOI_ANS"
        } ],
        "warnings" : [ ],
        "infos" : [ ]
      },
      "id" : "id-3fcf6164656fd9b93f2ddbd81c1c4b4d",
      "type" : "SIGNATURE"
    } ],
    "qmatrixBlock" : {
      "signatureAnalysis" : [ {
        "constraint" : [ {
          "name" : {
            "value" : "Is the signature/seal an acceptable AdES (ETSI EN 319 102-1) ?",
            "nameId" : "QUAL_IS_ADES"
          },
          "status" : "WARNING",
          "error" : null,
          "warning" : {
            "value" : "The signature/seal is not a valid AdES!",
            "nameId" : "QUAL_IS_ADES_INV"
          },
          "info" : null,
          "additionalInfo" : null,
          "id" : null
        }, {
          "name" : {
            "value" : "Is the certificate path trusted?",
            "nameId" : "QUAL_TRUSTED_CERT_PATH"
          },
          "status" : "NOT_OK",
          "error" : {
            "value" : "The certificate path is not trusted!",
            "nameId" : "QUAL_TRUSTED_CERT_PATH_ANS"
          },
          "warning" : null,
          "info" : null,
          "additionalInfo" : null,
          "id" : null
        } ],
        "conclusion" : {
          "indication" : "FAILED",
          "subIndication" : null,
          "errors" : [ {
            "value" : "The certificate path is not trusted!",
            "nameId" : "QUAL_TRUSTED_CERT_PATH_ANS"
          }, {
            "value" : "The certificate path is not trusted!",
            "nameId" : "QUAL_TRUSTED_CERT_PATH_ANS"
          } ],
          "warnings" : [ {
            "value" : "The signature/seal is not a valid AdES!",
            "nameId" : "QUAL_IS_ADES_INV"
          } ],
          "infos" : [ ]
        },
        "id" : "id-3fcf6164656fd9b93f2ddbd81c1c4b4d",
        "signatureQualification" : "NA"
      } ],
      "tlanalysis" : [ ]
    }
  }
}