Multiple Layers in Digital Signatures
Following an old format, digital signature field will sometimes define an appearance containing multiple entries / layers to be turned on or off based on the signature validity by the application at display time:
n0: Background layer.
n1: Validity layer, used for the unknown and valid state; contains, for instance, a yellow question mark.
n2: Signature appearance, containing information about the signature.
n3: Validity layer, used for invalid state..
n4: Text layer, for a text presentation of the state of the signature.
The use of layers n1, n3, and n4 is no longer recommended since Acrobat 6. Acrobat 6.0 and higher recommends that only layer n0 and n2 be present.
In IText, the method to add all these layers to a signature appearance is called setAcro6Layers().
No Support in Qoppa
Qoppa PDF rendering code does not have built-in logic to turn on or off the layers based on the signature validity. Our code follows the standard PDF specifications when it comes to rendering the appearance stream and is rendering all of the layers.
When rendering such signatures, the signature appearance may display both the question mark (from n1 layer) as well as the validity check mark if the signature was found to be valid.
Do you plan to add support for this?
No.There were good reasons for discontinuing this feature. A viewing application essentially has to modify the document (although only internally) based on the state of the digital signature, to remove commands to draw only some of the layers. This goes against the whole principle of digital signatures.
We’ve considered adding support for this, but there is a few factors that stopped us from doing so:
- This format has not been used since 2003, almost 10 years ago.
- Adobe recommends against using this.
- It would take significant effort to implement support for this.
- We could justify the effort if we saw a future for this feature, but considering that software is not supposed to use this, we think there are very few documents in existence, and probably close to none that will be created in the future that use this feature.