Digital signatures in PDF/A

Digital signatures are still not very widely used and the the knowledge about them is often fuzzy. This article tries to give an overview about this huge and complex topic.

The term digital signature refers to implementations of the more generic concept of an electronic signature on digital computers. The electronic signature is more used in conjunction with the legal aspect of such signatures. The functions of an electronic signature is to
  1. Replace the handwritten signature
  2. Ensure the integrity of a document (electronic seal)
  3. Convey the authenticity of the signer (electronic identity)
In the most countries electronic signatures are subject to the national legislature, e.g. in ZERTES Switzerland.

A digital signature is a cryptographic method to implement the above functions. In most cases the the signer owns a digital certificate and a private key. The private key is stored on a secure token or on a hardware security module (HSM). It is used to create the digital signature. The signer's certificate contains the corresponding public key and can be used to verify the signature.

PDF defines three types of signatures:
  1. Document signature: Any user of the document can apply such a signature and a document can be signed multiple times. Each user can add annotations to the document before it is signed. Each signature creates a specific revision of the document at the moment it is applied. This revision can later be reliably restored.
  2. Modification Detection and Prevention (MDP) signature: The author of the document can add a signature connected with specific action rights such as filling out forms which do not invalidate the integrity of a document. Only one such signature can be added to a document.
  3. Usage Rights (UR) signature: Any software can add these types of signature to enable specific reader functions such as the known Acrobat Reader Extensions.
The signatures themselves are a mixture of PDF objects and strings in a cryptographic message syntax. In order to provide maximum interoperability the embedding of a digital signature must follow specific rules which are listed here:
  •  PDF/A-1 is based on PDF 1.4 and does not specifically define any rules. The PDF/A Competence Center created therefore a document called Tech. Note. #6. I happen to be the editor of this document. You can get it from the PDF Association website.
  • PDF/A-2 and PDF/A-3 is based on PDF 1.7 which refers to the PAdES standard.
As it is always the case with blog posts this article is far from being in depth or even complete. The main goal is to invite you to post questions and start discussions. So, please post a comment and share your thoughts with others.


26 comments :

  1. One thing worries me a lot when I read the original ISO 32000 standard: it seems that signatures can only form a single continuous chain, each signature actually including the preceding one (which includes the preceding one ( which includes the preceding one ...(which ...) ) ) . Henceforth, there would be NO way of defining a workflow where we could collect multiple signatures asynchronously from the respective signatories. The signature process can only be sequential and one shall ensure a single electronic copy is carried over at all times. Well, we can think about holding a central copy and locking it when each participant come to review and sign it. There would be no other way. Do you confirm?

    ReplyDelete
    Replies
    1. Yes and no. Theoretically the standard allows for adding a signature with multiple signers in a single incremental update. However I've never seen a software which supports this. The vast majority works as you described, i.e. an incremental update for each individual signer.
      Thanks for the comment, by the way.

      Delete
    2. I have just been reading through the PAdES standard profile from ETSI in which they explicitly state that only serial signing is supported, and no 'parallel' signing. Actually, I think that the CMS-based signature format is selected (CAdES profile is also applicable) and enough space is reserved in the /Contents<...> PDF dictionary element for several SignerInfo blocks, nothing would prevent to handle multiple signatures and even countersignatures... so I don't understand the reason why they restricted the possibilities (?? extra security concerns...)

      Delete
    3. I don't know what the motivation for this restriction is. Please note, however, that PDF/A-1 must not conform to PAdES in contrast to PDF/A-2 and later parts.

      Delete
  2. I have another nasty question regarding signatures in PDF and PDF/A in particular. In full PDF which may contain modifyable form fields, it seems (if you can confirm) that every signature can actually modify the document (if authorised, e.g. editing form field values) before being applied. So I could crate a PDF doc where signers A, B, C in sequence would sign the same 'background form' yet can supply different field values (using indirect object versions?) into the same fields... which I would expect in PDF/A becomes impossible, such as to guaranty visual integrity... well, this is where the question is: fundamentally, a PDF field with three values can remain a high fidelity field with three values... provided the display does not pick the first or the last value arbitrarily but somehow arranges the display of the three values... gets wierd.. what is actually specified or limited by the PDF and PDF/A standards with signatures?

    ReplyDelete
    Replies
    1. For a regular PDF document you can indeed modify the form fields after each signature and resign. However, modifiable form fields are not allowed in PDF/A as the standard only allows static content. So with PDF/A the problem is not with signatures but with form fields.

      Delete
  3. This comment has been removed by a blog administrator.

    ReplyDelete
  4. Hi Aeldra - Thank you for your comment. Unfortunately we had to delete it as our policy doesn't allow for advertising.

    ReplyDelete
  5. I am no expert in the PDF arena but I'm looking for an answer and found this blog.

    I have a question related to PDF/A and digital signatures. My question is this, if the PDF/A format is to specifically allow a document stored today to be accessed many years from now, and I add a digital signature, wouldn't that signature and the validation of it be different in years to come? Therefore is it allowable to have digital signatures in the PDF/A format? Sorry for my ignorance if this is a stupid question.

    Many thanks

    Martin

    ReplyDelete
    Replies
    1. It is allowed to digitally sign a PDF/A document. However, in order to retain the PDF/A conformance the signature must conform to the rules of PDF/A as well. The signature software must explicitely support this. Which signature type you need depends on its purpose. If you need e.g. to exchange an invoice document then the signature usually must only be valid for a short time period, that is until the receiver has verified it. However, if you need a signature which you need to verify for a longer period of time then it must conform to the LTV (long term validation) rules as defined in the PAdES digital signature standard.

      Delete
  6. Sorry Hans I have a further question. I think I know the answer to this but it would be good to get it confirmed. Can I change formats of PDF's that contain a digital signature without compromising the validity of the signature? For example, if I have a PDF/X with a digital signature, can I convert this to PDF/A for archiving and maintain the digital signature?

    Once again, I thank you for your time and patience.

    Kind regards

    Martin

    ReplyDelete
    Replies
    1. No, you can't because the conversion process breaks the signature. The process in such cases is usuall something like this: you verify the original signature and create a verification report. You then add the report to the document, convert it and add a new digital signature.

      Delete
    2. Thank you Hans for both of your replies.

      One final question if I may?

      Is there an reason we couldn't print the PDF/A version sent to us then archive it? Rather than using the PDF/X? What do we lose doing that?

      Kind regards

      Martin

      Delete
    3. I not aware of any reason against using the PDF/A version for printing. Both standards PDF/X and PDF/A are very similar. And, theoretically, a document can conform to both standards if the producer is able to create such a document.

      Delete
  7. This comment has been removed by the author.

    ReplyDelete
  8. Thanks for publishing this article. I have been signing and certifying PDFs for quite some time, but only recently came upon a requirement to save in PDF/A format. The challenge has been finding the exact order (sign then save as PDF/A-compliant, or save as PDF/A-compliant then sign) and steps using Adobe Acrobat XI. Both certifying and running preflight to save as PDF/A-1b seem to be "final steps" before saving.

    Can you help a n00b understand the precise steps and options required to sign a PDF/A document please?

    Thanks!

    - Dave

    ReplyDelete
    Replies
    1. Dear Dave,
      Thank you for your comment.
      From a technical perspective the steps must be as follows: The conversion from PDF to PDF/A must be done before signing the document because this step would invalidate a signature. After this you have two possibilities. You add a signature without appearance or one with appearance. If you add a signature without appearance then you are done and the result does conform to PDF/A. However, if you add a signature with appearance you must use a signing software that creates a signature appearance which conforms to PDF/A itself and signs the document in one step. If this is not the case then the whole document does not conform to PDF/A.
      Acrobat can certainly add signatures without destroying the PDF/A conformance of the original document. But I'm not sure whether it can create PDF/A conforming appearances.

      Delete
    2. Thanks for the rapid reply, Hans.

      With your help, I found the steps in Adobe Acrobat XI to be:

      1) Preflight → Standards → Save as PDF/A → Create PDF/A-1b → Save as...
      2) Without exiting Acrobat: File → Save As Other → Certified PDF (select "No changes allowed")

      Oddly, choosing to "Certify (Not Visible)" in Step 2 somehow invalidates the PDF/A conformance. This was a major stumbling block in my earlier trials, since I only wanted the PDF/A document certified, not "signed".

      - Dave

      Delete
  9. Hi Hans, first at all, thanks for your post, it's very ilustrative.
    I'm trying to sign a PDF document, that previously conform to PDF/A, with a client provided by the Spanish government (http://administracionelectronica.gob.es/ctt/clienteafirma#descripcion).
    I've seen that you told Dave Dugal that "If you add a signature without appearance then you are done and the result does conform to PDF/A".
    This client doesn't add any appearance in the sign process and, even so, the document signed doesn't conform PDF/A.
    Could you tell me, please, what more I should check?
    Thanks in advance.

    ReplyDelete
  10. This comment has been removed by the author.

    ReplyDelete
  11. Testing the signed document with "PDF Validator Online Tool" I obtained the next result:
    "XXXXXXX.pdf does not conform to PDF/A.
    Validating file "XXXXXXX.pdf" for conformance level pdfa-1b
    Multiple occurrences of property 'pdf:Producer'.
    Multiple occurrences of property 'xmp:ModifyDate'.
    The document does not conform to the requested standard.
    The document's meta data is either missing or inconsistent or corrupt.
    Done."
    I've compared the metadata of the document before and after the sign and I've figured out that, after the sign, precisely in the metadata, inside the tag appear two additional tags, and .
    So, I think that I'll have to avoid that the sign process include those tags, isn't it?

    ReplyDelete
    Replies
    1. Sorry, tags I'm talking about don't appear in my reply. These are pdf:Producer and xmp:ModifyDate, precisely

      Delete
    2. Hi Angel
      Thank you for your comment. It's not easy to say what's wrong with only the error messages. Can you send me the file for further analysis? Thank you very much.

      Delete
  12. Although a digital certificate is one of the safest ways to send files & documents over the web, not many are super sure about its efficiency to work in real-time.
    Thus, a digital certificate file, especially PDFs should always be cross-checked before downloading to keep out the risks from hackers.
    BookMyIdentity offers quality & affordable digital certificate package that you can rely on!

    ReplyDelete
  13. Hi Hans Barfuss,

    Appreciation for your detailed and helpful article. I have a PDF/A-1b document, I confirmed his conformance through Preflight, it was OK. But when I try to create a visible digital signature with certify permissions (No Changes Allowed). Adobe Reader says Signature is INVALID but the PDF/A-1b level is OK confirmed with Pre-flight. Would you tell me is there any restriction to apply visible digital certify signature on the PDF/A document.

    ReplyDelete
    Replies
    1. Hi Ahmed,
      Thank you for your comment.
      There can be many reasons why Acrobat flags a signature. To use a root certificate that is not trusted by Acrobat is just one such example. For a detailed analysis I would need to inspect the document.
      Generally, PDF/A-1b only allows for document signatures not MDP signatures.

      Delete