Hi, im getting the following error message when i try to add a timestamp:

"The key /Contents is too big. Is 11776, reserved 3890"

Im following the example at
http://www.nabble.com/PDF-Digital-signature-with-timestamp---using-Time-Stam
p-Authority---example-td11798693.html
, if I don’t use a tsaClient all goes fine, but if I use a tsaClient in
sig.getEncodedPKCS7(null,null,tsaClient) , then I get a lot more bytes.

What can I do to reserve this bytes? Ive tried this, but with no succcess:
HashMap exc = new HashMap();
exc.put(PdfName.CONTENTS, new
PdfString("15000".getBytes()).setHexWriting(true));
sap.preClose(exc);



This is part of the code im using:


     sap.setCrypto(null, chain, null, PdfSignatureAppearance.WINCER_SIGNED);

...
sap.setExternalDigest(new byte[128], null, "RSA");
  sap.preClose();
...
              PdfSigGenericPKCS sg = sap.getSigStandard();
              PdfLiteral slit = (PdfLiteral)sg.get(PdfName.CONTENTS);
              byte[] outc = new byte[(slit.getPosLength() - 2) / 2];   

....

              sig.setExternalDigest(pkcs11Session.signFinal(), null, "RSA");
          PdfDictionary dic = new PdfDictionary();


              byte[] ssig = sig.getEncodedPKCS7(null,null,tsaClient);
              dic.put(PdfName.CONTENTS, new
PdfString(ssig).setHexWriting(true));

     sap.close(dic);



I know something is wrong, but I don’t have a clue, any help would be
appreciated.

Regards.
 

__________ Información de ESET NOD32 Antivirus, versión de la base de firmas
de virus 2945 (20080313) __________

ESET NOD32 Antivirus ha comprobado este mensaje.
http://www.eset.com
 


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Do you like iText?
Buy the iText book: http://www.1t3xt.com/docs/book.php
Or leave a tip: https://tipit.to/itexttipjar

Reply via email to