there! I'm using pdfbox 1.8.11 to do pdf signature, I could create a LTV-enabled signature with DSS dictionary embedded. Now the problem is the certificate verification when there are multiple signatures.
According to PDF 2.0 LTV and PAdES LTV specification, it is allowed to add VRI for each signature, so that it is possible verify related revocation data for each specific signature.
Any idea how to add VRI dictionary for the signature? As the key for VRI is the a base-16-encoded hash, which means I need to have signature first. As far as I know (I hope i was wrong), the signature is created when the PDF with signature related information is saved into output stream. (PDDocument.saveIncremental(ins, outs)
)
============================================================
more in detail:
I ran into this problem when I want to verify the signature against DSS data according to the PAdES LTV and PDF 2.0 LTV specification. First focus is the PDF 2.0 LTV specification.
If i understand correctly:
- The DSS contains revocation data for all signatures we have in the signed PDF.
The situation I ran into: Assume: there are two users User A and User B, their certificates are issued by the same CA:s. (It's quite common I think. )
- User A signed the document with DSS (certs/crls/ocps are embeded).
- Days later, User B sign the User A signed document with DSS (certs/crls/ocps). Note!: crls are identified by issuer identifier.
Signature verification phase:
When I want to rebuild the certificates chain, verify the sign certificate against the crls and ocsps, especially when I want to check the crl is not expired at the time when the document is signed, I need to make sure I'm using the right version of crl.
To me, it means I should check certs/crls/ocsps correctly mapped with the signature. Otherwise the verification is reliable any more, equally meaningless.
Therefore, even though the latest PAdES specification 103 does not recommend to use VRI. Seriously, I think it is not right....
Then another problem:
As I commented bellow, I'm using pdfbox to sign pdf.
If I collect DSS data beforehand, create the signature afterwards. (The fact is that the DSS is also part of the signed content.)
- Good thing: acrobat reader recognize my signature is LTV enabled.
- Bad thing: in such situation, I'm not able to add VRI there. The key for VRI is hashed value of the signature.
If I sign the document first, got the signature and DSS with VRI afterwards, acrobat reader does not recognize the DSS any more. My signature is no longer LTV enabled to acrobat reader. It is the problem I'm confused. Is acrobat reader wrong in LTV verification or ??
Do I think it wrong? If anything I understood wrong, please do point it out. Thanks in advance!