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