Hi Nicolas,

dtmo the handling of PIN numbers for SmartCards is a topic that is out of the 
scope of iText. In the very end it's a feature of your SmartCard to support 
multiple signs with one PIN entry, or not. In your case you should investigate 
in the direction of your special crypto provider.

If you are heading in the direction of mass signing of PDF files, you may want 
to take a look at http://sourceforge.net/projects/sirius-sign/ ....

Greetings

Andreas




________________________________
From: Nicolás Penalba Zanón <[email protected]>
To: [email protected]
Sent: Wednesday, April 8, 2009 9:34:57 AM
Subject: [iText-questions] signing PDF files with a cryptographic smart card

 
Hello,
 
I'm doing a little program to sign PDF files, my 
certificate is stored in a cryptographic smart card and when it is 
necessary I have to introduce the PIN number. It works. Now I want to sign 
some PDF files simultaneously, introducing the PIN number only one more 
time. It is possible? Any idea?
 
Thank you!
 
P.S.: Here is my source code:
 
keyStore = 
KeyStore.getInstance("Windows-MY");
keyStore.load(null, null);

String alias = "MY 
ALIAS";
 
KeyStore.PrivateKeyEntry pkEntry = 
(KeyStore.PrivateKeyEntry) keyStore.getEntry(alias, null);
PrivateKey 
myPrivateKey = pkEntry.getPrivateKey();

Certificate[] chain = 
pkEntry.getCertificateChain();
 
PdfReader reader = new 
PdfReader("test.pdf");
FileOutputStream fout = new 
FileOutputStream("test_s.pdf");
PdfStamper stp = 
PdfStamper.createSignature(reader, fout, '\0', new 
File("tmp.pdf"));
PdfSignatureAppearance sap = 
stp.getSignatureAppearance();
sap.setCrypto(myPrivateKey, chain, null, 
PdfSignatureAppearance.SELF_SIGNED);
sap.setReason("Testing 
iText");
sap.setLocation("Location");
sap.setContact("Contact");
sap.setVisibleSignature(new 
Rectangle(100, 300, 500, 400), 1, 
null);
stp.close();
------------------------------------------------------------------------------
This SF.net email is sponsored by:
High Quality Requirements in a Collaborative Environment.
Download a free trial of Rational Requirements Composer Now!
http://p.sf.net/sfu/www-ibm-com
_______________________________________________
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

Reply via email to