Jared,

Javadoc wrote:
> From the iText website: "During the PDF creation process, files can also
> be encrypted and digitally signed." I would like to find out more about
> this, but after extensive searching, I haven't found any information. Does
> anyone have any examples? I would like to sign the PDF before the file is
> ever written to disk if possible. I've done plenty of signing and signing
> with external signatures before but I've always done so to existing PDF
> files and never a new one.

Signing with iText is implemented using a PdfStamper. This implies that you
already have to have a PDF document which you sign in a separate step. Of
course you may have created that initial PDF document in memory, e.g. in
some ByteArrayOutputStream, and use a PdfReader working on that byte[] to
feed your PdfStamper. Such a workflow very likely is both what was meant
with the sentence you quoted and what you should do to sign your documents
as early as possible, at least if your documents are of moderate size.

Sample code for both steps is available on the web site, you merely have to
use a ByteArrayOutputStream instead of a FileOutputStream in the first step
and the generated byte[] instead of a file name as input for the PdfReader
in the second one. There actually is sample code for two-pass PDF
generation, too.

Beware though: During the signing process you can, for a short time, find a
file on disk which is your original PDF plus some extra objects, one of them
prepared to eventually hold the signature but being empty at that time.

Regards,   Michael.
-- 
View this message in context: 
http://itext-general.2136553.n4.nabble.com/Digitally-signing-on-the-fly-on-creation-tp2538251p2538500.html
Sent from the iText - General mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.itextpdf.com/book/
Check the site with examples before you ask questions: 
http://www.1t3xt.info/examples/
You can also search the keywords list: http://1t3xt.info/tutorials/keywords/

Reply via email to