Hi all!
I'm new to iText and I'm developing (in Java) a class to sign PDF documents with a smartcard. I'm using Sun PKCS11 provider to access certificates and keys on the smartcard. I've tried to set the external cryptographic provider in the PdfSignatureAppearance and the signing process is working, but there is a small problem:

the authentication's PIN is correctly asked once (to gain access to Keystore), while the signing's PIN is asked 2 times instead of once. Why? I don't believe it's a provider's configuration related problem because I used the same configuration to sign documents with Bouncy Castle in PKCS#7 format.

The relevant part of source code follows.

PdfReader reader = new PdfReader(isPdfToSign);
PdfStamper writer = PdfStamper.createSignature(reader, osPdfSigned, '\0');
PdfSignatureAppearance psa = writer.getSignatureAppearance();
psa.setReason("a reason");
psa.setLocation("here");
psa.setCrypto(privateKey, chain, null, PdfSignatureAppearance.WINCER_SIGNED);
psa.setProvider("SunPKCS11-Actalis");
writer.close();

Thanks to anyone can support me

<<attachment: roberto_coppi.vcf>>

------------------------------------------------------------------------------
Increase Visibility of Your 3D Game App & Earn a Chance To Win $500!
Tap into the largest installed PC base & get more eyes on your game by
optimizing for Intel(R) Graphics Technology. Get started today with the
Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
http://p.sf.net/sfu/intelisp-dev2dev
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Many questions posted to this list can (and will) be answered with a reference 
to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples: 
http://itextpdf.com/themes/keywords.php

Reply via email to