Thanks again Andreas......but I'm an incredible problems generator. :-)
The sign byte array(128 byte length) that CA returns to me is a RSA cypher of a
Pdf hashcode.
How can I generate a PdfPKCS7 object from this byte array??
I need this kind of object to generate the byte array that has to be used in
replacement of placeholder in Pdf file.
Best Regards,
Stefano.
------------------------------------------------------
Stefano Badiali
Architetture
Sistemi Informativi di Gruppo
Sistemi Informativi Allianz
Tel. +39 02 7216 4342
Email: [email protected]
------------------------------------------------------
P Prima di stampare questa mail, pensa all'impatto sull'ambiente - Please
consider the environment before printing this e-mail.
________________________________
Da: Andreas Kuehne [mailto:[email protected]]
Inviato: lunedì 20 aprile 2009 16.19
A: Badiali Stefano
Oggetto: Re: [iText-questions] Pdf signature Issues
Hi Stefano,
adding a timestamp as an unauthenticated attribute won't cause problems. Just
read the signature you recieve into a Java object ( BouncyCastle has a
signature object ) and the timestamp, too. The signature object got a list of
unauthenticated attributes, maybe there are already some attributes present.
Here you can add your timestamp object and write the signature back into a byte
array and proceed as usual.
I don't have code at hand. If you see problems, don't hesitate to ask ...
Greezings
Andreas
________________________________
From: Badiali Stefano <[email protected]>
To: Andreas Kuehne <[email protected]>; [email protected]
Sent: Monday, April 20, 2009 3:33:28 PM
Subject: Re: [iText-questions] Pdf signature Issues
Thanks Andreas.
I have another question for you.
In my process I have to handle a Timestamp too, then I have two byte arrays
returned by my CA webservices. The first is the sign, the second is the
timestamp.
The timestamp must become a signature attribute.
Is it possible to apply the same replacement you suggested to me in your
response in this case too?
Best Regards,
Stefano.
------------------------------------------------------
Stefano Badiali
Architetture
Sistemi Informativi di Gruppo
Sistemi Informativi Allianz
Tel. +39 02 7216 4342
Email: [email protected]
------------------------------------------------------
P Prima di stampare questa mail, pensa all'impatto sull'ambiente - Please
consider the environment before printing this e-mail.
________________________________
Da: Andreas Kuehne [mailto:[email protected]]
Inviato: mercoledì 15 aprile 2009 17.23
A: Badiali Stefano; [email protected]
Oggetto: Re: [iText-questions] Pdf signature Issues
Hi Stefano,
don't worry, you're facing a quite common use case.
We implemented a way to fullfil this requirements in our sirius signing server.
The PDFStamper is closed after calculating the hash and we insert the
ready-build signature later on. You may take a look at
PDFPKCS7ProcessorBean.java attached to this mail :
The method 'prepare' does all the PDFStamper and hashing stuff, in the method
'encode' the PKCS7 signature is inserted into the PDF file.
On the other hand you may use our ready-build signing server available at
http://sourceforge.net/projects/sirius-sign/ .
Good luck ;-)
Andreas
----- original Nachricht --------
Betreff: [iText-questions] Pdf signature Issues
Gesendet: Mi, 15. Apr 2009
Von: Badiali Stefano
Hi,
my name is Stefano from Milan, Italy.
I'm currently working on a project that involves an extensive usage of IText
library.
In particular I'm coping with a problem regarding the appliance of signature to
the PDF: at the present day, in fact, I'm forced to apply the signature to a
calculated hash-code associated to the PDF document keeping "alive" the
PdfStamper object (that is to say I cannot close and reopen it just before
marking the document with the desired signature; if I did so, the resulting
document would be correctly signed but it would also appear as if it were
modified).
So, in a nutshell, I wonder whether it may be possible to apply the signature
to the calculated hash-code of a PDF document in a sort of asynchronous mode:
- First I calculate the hash-code of the document by means of an instance of
the PdfStamper object;
- Then I close the PdfStamper itself and I wait for the signature avalaibility
- Finally when the signature is available (after an unpredictable slice of
time), I reopen the PdfStamper and apply the signature itself to the document
I also ask you whether such a behaviour can ben considered acceptable or is
"forbidden" because of security issues.
In other words, is there a specific concern that explains why the current IText
API version does not provide the means for implementing the asynchronous mode
I've previously described?
Thanks in advance and while waiting for your kind answer I pledge
Best regards
Le informazioni contenute in questo messaggio e gli eventuali allegati (il
"Messaggio") si intendono inviate a uno o piu' specifici destinatari. Il
contenuto del Messaggio puo' essere confidenziale, riservato e comunque
protetto dalla legge applicabile. Se non siete i destinatari del Messaggio,
siete pregati di informare immediatamente il mittente, cancellate questo
Messaggio, non rivelatelo, non distribuitelo ne' inoltratelo a terzi, non
copiatelo ne' fatene alcun uso.
Questo Messaggio ha natura aziendale e non personale. Pertanto le risposte
inviate a seguito di questa comunicazione potranno essere conosciute
nell'organizzazione di appartenenza del mittente nei limiti e secondo le
regole fissate dall'azienda, nel rispetto della vigente normativa e del
disciplinare interno. Qualsiasi pubblicazione, utilizzo o
diffusione, anche
parziale di questo Messaggio deve essere preventivamente autorizzata.
I messaggi di posta elettronica non sono sicuri e sono soggetti ad
alterazioni, possono essere trasmettitori di Virus informatici o soggetti
a ritardi nella distribuzione. Il mittente del Messaggio non puo' essere
in alcun modo considerato responsabile per queste evenienze. Il mittente si
riserva il diritto di archiviare, ritenere e controllare i messaggi di posta
elettronica.
The information contained in this electronic message and any attachments (the
"Message") is intended for one or more specific individuals or entities, and
may be confidential, proprietary, privileged or otherwise protected by law.
If you are not the intended recipient, please notify the sender immediately,
delete the Message and do not disclose, distribute, or copy it to any third
party or otherwise use the Message.
The
Message has business character and not private and/or individual
character. Your reply to the Message could be disclosed to the sender entity,
according to and in respect of its internal rules, under the applicable laws,
regulations or internal policies. Any publication, use or circulation of the
Message, both total and partial, have to be previously authorized.
Electronic messages are not secure or error free and can contain viruses or
may be delayed, and the sender is not liable for any of these occurrences.
The sender reserves the right to monitor, record and retain electronic
messages.
--- original Nachricht Ende ----
Le informazioni contenute in questo messaggio e gli eventuali allegati (il
"Messaggio") si intendono inviate a uno o piu' specifici destinatari. Il
contenuto del Messaggio puo' essere confidenziale, riservato e comunque
protetto dalla legge applicabile. Se non siete i destinatari del Messaggio,
siete pregati di informare immediatamente il mittente, cancellate questo
Messaggio, non rivelatelo, non distribuitelo ne' inoltratelo a terzi, non
copiatelo ne' fatene alcun uso.
Questo Messaggio ha natura aziendale e non personale. Pertanto le risposte
inviate a seguito di questa comunicazione potranno essere conosciute
nell'organizzazione di appartenenza del mittente nei limiti e secondo le
regole fissate dall'azienda, nel rispetto della vigente normativa e del
disciplinare interno. Qualsiasi pubblicazione, utilizzo o diffusione, anche
parziale di questo Messaggio
deve essere preventivamente autorizzata.
I messaggi di posta elettronica non sono sicuri e sono soggetti ad
alterazioni, possono essere trasmettitori di Virus informatici o soggetti
a ritardi nella distribuzione. Il mittente del Messaggio non puo' essere
in alcun modo considerato responsabile per queste evenienze. Il mittente si
riserva il diritto di archiviare, ritenere e controllare i messaggi di posta
elettronica.
The information contained in this electronic message and any attachments (the
"Message") is intended for one or more specific individuals or entities, and
may be confidential, proprietary, privileged or otherwise protected by law.
If you are not the intended recipient, please notify the sender immediately,
delete the Message and do not disclose, distribute, or copy it to any third
party or otherwise use the Message.
The Message has business character and not
private and/or individual
character. Your reply to the Message could be disclosed to the sender entity,
according to and in respect of its internal rules, under the applicable laws,
regulations or internal policies. Any publication, use or circulation of the
Message, both total and partial, have to be previously authorized.
Electronic messages are not secure or error free and can contain viruses or
may be delayed, and the sender is not liable for any of these occurrences.
The sender reserves the right to monitor, record and retain electronic
messages.
Le informazioni contenute in questo messaggio e gli eventuali allegati (il
"Messaggio") si intendono inviate a uno o piu' specifici destinatari. Il
contenuto del Messaggio puo' essere confidenziale, riservato e comunque
protetto dalla legge applicabile. Se non siete i destinatari del Messaggio,
siete pregati di informare immediatamente il mittente, cancellate questo
Messaggio, non rivelatelo, non distribuitelo ne' inoltratelo a terzi, non
copiatelo ne' fatene alcun uso.
Questo Messaggio ha natura aziendale e non personale. Pertanto le risposte
inviate a seguito di questa comunicazione potranno essere conosciute
nell'organizzazione di appartenenza del mittente nei limiti e secondo le
regole fissate dall'azienda, nel rispetto della vigente normativa e del
disciplinare interno. Qualsiasi pubblicazione, utilizzo o diffusione, anche
parziale di questo Messaggio deve essere preventivamente autorizzata.
I messaggi di posta elettronica non sono sicuri e sono soggetti ad
alterazioni, possono essere trasmettitori di Virus informatici o soggetti
a ritardi nella distribuzione. Il mittente del Messaggio non puo' essere
in alcun modo considerato responsabile per queste evenienze. Il mittente si
riserva il diritto di archiviare, ritenere e controllare i messaggi di posta
elettronica.
The information contained in this electronic message and any attachments (the
"Message") is intended for one or more specific individuals or entities, and
may be confidential, proprietary, privileged or otherwise protected by law.
If you are not the intended recipient, please notify the sender immediately,
delete the Message and do not disclose, distribute, or copy it to any third
party or otherwise use the Message.
The Message has business character and not private and/or individual
character. Your reply to the Message could be disclosed to the sender entity,
according to and in respect of its internal rules, under the applicable laws,
regulations or internal policies. Any publication, use or circulation of the
Message, both total and partial, have to be previously authorized.
Electronic messages are not secure or error free and can contain viruses or
may be delayed, and the sender is not liable for any of these occurrences.
The sender reserves the right to monitor, record and retain electronic
messages.
------------------------------------------------------------------------------
Stay on top of everything new and different, both inside and
around Java (TM) technology - register by April 22, and save
$200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
300 plus technical and hands-on sessions. Register today.
Use priority code J9JMT32. http://p.sf.net/sfu/p
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://www.1t3xt.com/docs/book.php