PAdES (PDF Advanced Electronic Signatures) is a set of restrictions and extensions to PDF and ISO 32000-1 making it suitable for Advanced Electronic Signature. This is published by ETSI as TS 102 778.

While PDF and ISO 32000-1 provide a framework for digitally signing their documents, PAdES specifies precise profiles making it compliant with the European eIDAS regulation (Regulation on electronic identification and trust services for electronic transactions in the internal market). The eIDAS regulation enhances and repeals the Electronic Signatures Directive 1999/93/EC. EIDAS is legally binding in all EU member states since July 2014. An electronic signature that has been created in compliance with eIDAS has the same legal value as a handwritten signature.

An electronic signature, technically implemented based on PAdES has the status of an advanced electronic signature. This means that

• it is uniquely linked to the signatory;
• it is capable of identifying the signatory;
• only the signatory has control of the data used for the signature creation;
• it can be identified if data attached to the signature has been changed after signing.

One important benefit from PAdES is that electronically signed documents can remain valid for long periods, even if underlying cryptographic algorithms are broken.

PAdES recognizes that digitally-signed documents may be used or archived for many years – even many decades. At any time in the future, in spite of technological and other advances, it must be possible to validate the document to confirm that the signature was valid at the time it was signed – a concept known as Long-Term Validation (LTV).

The PAdES standard, ETSI Technical Specification (TS) 102 778, introduces a number of adaptations and extensions to PDF to satisfy the Directive's requirements. ETSI will feed these European-specific elements back into ISO for inclusion in the next release of the PDF standard, ISO 32000-2.

The PAdES standard (ETSI TS 102 778) profiles support for PDF 1.7 format (ISO 32000-1) digital signatures for including advanced digital signatures in PDF documents. It also extends this support as it defines additional data structures for maintaining signature validity over time. It is planned for the ISO 32000-1 extensions defined by PAdES to be included in ISO 32000-2.

Specifically, PAdES (ETSI TS 102 778) defines the following profiles:

• PAdES-CMS: This profile defines a CMS/PKCS#7 digital signature based on ISO 32000-1, which requires that the /ByteRange key of the digital signature dictionary covers the entire file and that the /subFilter key only contains the values adbe.pkcs7.detached and adbe.pkcs7.sha1. In addition, this profile recommends including a time-stamp as an unsigned attribute of the CMS/PKCS#7. The TrustedX digital signature services currently support signing PDF documents using this PAdES profile.
• PAdES-BES and PAdES-EPES: This profile defines CAdES-BES (ETSI TS 101 733) and CAdES-EPES (ETSI TS 101 733) digital signatures that require that the /ByteRange key of the digital signature dictionary covers the entire document and that the /subFilter key contains the value ETSI.CAdES.detached. Use of the/Cert key is prohibited. Both digital signature types allow including a time-stamp, which would, in fact, make them CAdES-T (ETSI TS 101 733) digital signatures. So, the PAdES-BES and PAdES-EPES digital signatures have the same characteristics as the CAdES-BES, CAdES-EPES and CAdES-T digital signatures. The TrustedX digital signature generation service currently supports signing PDF documents using this PAdES profile.
• PAdES-LTV: This profile constitutes an extension of ISO 32000-1 as it defines two structures that support extending digital signature validity for any length of time. On the one hand, it defines the DSS (Document Security Store) dictionary for storing all the validation data (CA certificates, CRLs and OCSP responses) required to validate the document digital signatures, and on the other, it defines the Document Time-stamp dictionary, which is an ISO 32000-1 digital signature dictionary whose /subFilter key has the value ETSI.RFC.3161 and which contains a time-stamp for the entire PDF document, including the DSS dictionary containing all the validation data for the signatures. This time-stamp maintains, while it is valid, the proof value for the validation data of the digital signatures. I.e., it maintains their strength beyond their expiry date. Furthermore, before the first time-stamp expires, the DSS and Document Time-stamp structures can be reused to maintain the proof value of this stamp and so maintain the digital signature's validity. In this case, the DSS dictionary contains the validation data of the first time-stamp, and the Document Time-stamp dictionary contains a second time-stamp that, again, covers the entire document. Thus, by repeating the addition of a DSS dictionary that contains the validation data of the last time-stamp and the addition of the Document Time-stamp dictionary, the validity of digital signatures in PDF documents can be maintained for any length of time. By using the PAdES-LTV profile on the PDF documents that contain the digital signatures generated as per the PAdES-BES and PAdES-EPES profiles, digital signatures with the same long-term characteristics as the CAdES-XL and CAdES-A (ETSI TS 101 733) are obtained. The TrustedX digital signature generation service currently supports updating PDF documents using this PAdES-LTV profile.
• PAdES-XML: This profile comprises a set of profiles that describe how to use the XAdES (ETSI 101 903) digital signatures in PDF documents. Specifically, a distinction is made between any XML documents signed as per XAdES and XFA forms signed as per XAdES.

# 1 Enum constants

For either signature level, signature packaging and digest algorithm and enum constant is provided.

Copy
<script>
</script>

# 2 Signature example

Sign a PDF document without any text layer or image.

Copy
<script>

var ksStream = new Ax.net.URL('https://bitbucket.org/deister/axional-docs-resources/raw/master/KeyStores/swview/jks-files/jack.jks');

var ks = new Ax.ks.KeyStoreManager(ksStream.getInputStream(), "secret");

var src = new Ax.net.URL('https://bitbucket.org/deister/axional-docs-resources/raw/master/PDF/sample.pdf');

// Sign the document using keystore private key alias "jack" with password "moon"
.setTspServer("http://tsa.belgium.be/connect")
.setReason("The reason I sign")
.setContactInfo("The contact information")
.setSignatureName("The signature name")
.sign(ks, "jack", "moon")
;

console.log(tmp);
</script>

# 3 Signature with image

Sign a document and place an image icon at first page. Image is provided as Bas64 encoded string.

Copy
<script>
var ks = new Ax.ks.KeyStoreManager ("https://bitbucket.org/deister/axional-docs-resources/raw/master/KeyStores/swview/jks-files/jack.jks", "secret");

var src = new Ax.net.URL('https://bitbucket.org/deister/axional-docs-resources/raw/master/PDF/sample.pdf');

// Sign the document using keystore private key alias "jack" with password "moon"
.setTspServer("http://tsa.belgium.be/connect")
.setReason("The reason I sign")
.setContactInfo("The contact information")
.setSignatureName("The signature name")
.setSignatureImageParameters(options => {
options.setPage(1);
options.setxAxis(20);
options.setyAxis(20);
//options.setWidth(100);
//options.setHeight(100);
//options.setRotation(180);
})
.sign(ks, "jack", "moon")
;

</script>

# 4 Signature with text only

Sign a document and place an image text at first page.

Copy
<script>
var ks = new Ax.ks.KeyStoreManager("https://bitbucket.org/deister/axional-docs-resources/raw/master/KeyStores/swview/jks-files/jack.jks", "secret");

var src = new Ax.net.URL('https://bitbucket.org/deister/axional-docs-resources/raw/master/PDF/sample.pdf');

// Sign the document using keystore private key alias "jack" with password "moon"
.setTspServer("http://tsa.belgium.be/connect")
.setReason("The reason I sign")
.setContactInfo("The contact information")
.setSignatureName("The signature name")
.setSignatureImageParameters(options => {
options.setPage(1);
options.setxAxis(20);
options.setyAxis(20);
options.setText("The signatue text");
options.setTextColor(255, 255, 0);
options.setBackgroundColor(255, 0, 0);
options.setSignerNamePosition("TOP");
options.setSignerTextHorizontalAlignment("LEFT");
})
.sign(ks, "jack", "moon")
;

</script>