PAdES (PKCS11) and Zend_Pdf

Similar to my last post about Zend_Mail S/MIME class, this one allows to digitally sign and even add TSA (timestamping) support to your PDF documents generated using Zend_Pdf. There is a standalone ASN1 parser included that can be used for other projects that require ASN1 data interchange. See for reference. The challenge was to add the BytesRange element with right byte bounds of the signed document. How to use it:

    'Name' => 'Someone',
    'Location' => 'Kharkov, UA',
    'Reason' => 'I'm approving this document',
    'ContactInfo' => ''
    'TSA_username' => '',
    'TSA_password' => '',
    'TSA_url'      => '',
    'TSA_cert'     => '',
    'TSA_algorithm' => 'sha1'
$fp = fopen('tmp3.pdf','w');

Note, that you need a writeable by php user directory (tmp in the example above). See attached Zend_Pdf modified class + Zend_ASN1 parser.


Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert.

This site uses Akismet to reduce spam. Learn how your comment data is processed.