Hello :)

I can show you the code i use to initialize the builder i use to get the
keystore,
from what i understand it uses a pkcs11 library to get its provider and a
handler that eventually asks for the smarcard's pin.

code:
          private static void initBuilder(){
                  try {
                        //TODO por em funçao do SO como em cima o pkcs11
                        String pkcs11config = "name=GemPC" + "\n"
                                                                + 
"library=C:/WINDOWS/system32/pteidpkcs11.dll";
                        byte[] pkcs11configBytes = pkcs11config.getBytes();
                        ByteArrayInputStream configStream = new
ByteArrayInputStream(pkcs11configBytes);
                        Provider p = new SunPKCS11(configStream);
                        configStream.close();
                        if(Security.getProvider(p.getName()) == null){
                                Security.addProvider(p);
                                System.out.println("Just added the provider");
                        }
                        else
                                System.out.println("Already added the 
provider");
                        CallbackHandler cmdLineHdlr = new
com.sun.security.auth.callback.TextCallbackHandler();
                        builder = KeyStore.Builder.newInstance("PKCS11", p, 
                                          new 
KeyStore.CallbackHandlerProtection(cmdLineHdlr));
                        } catch (Exception e) {
                                e.printStackTrace();
                        }
          }


by the way, how do you know the sign method returns 131 bytes instead of
128?
when i look at the signedHash length, it returns 128.
Doesnt the length have anything to do with the 131 bytes you mention?

Regards,
Pedro
-- 
View this message in context: 
http://itext-general.2136553.n4.nabble.com/Another-invalid-signature-thread-tp3003710p3005813.html
Sent from the iText - General mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in  U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store 
http://p.sf.net/sfu/nokia-dev2dev
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
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