Hi, Thanks a lot for your reply! There was really a problem with the Android KeyStore because when I load the .p12 file without the Android API it works. It´s sad because this isn´t a very good solution....
I hope Google will provide a better solution for this in the future ;) Regards, Florian -----Ursprüngliche Nachricht----- Von: Michael Demey [mailto:michael.de...@itextpdf.com] Gesendet: Donnerstag, 4. Juli 2013 14:45 An: Post all your questions about iText here Betreff: Re: [iText-questions] Android example code: Sign pdf with *.p12 certificate Hi, What version of Android are you using? 4.1 seems to be having some issues with the getPrivateKey method of KeyChain. Some stackoverflow questions: http://stackoverflow.com/questions/12507697/keychain-getprivatekeycontext-string-on-android-4-1 http://stackoverflow.com/questions/11261774/using-android-4-1-keychain From the second URL: "After further debugging and by contacted by a Google engenier (Thanks!) it turned out that Android registers differents JAVA Crypto providers and only the OpenSSL Provider is able to use the PrivateKeys from the Keystore." I haven't got much experience using the KeyStore on Android, so you'll have to look a bit further on your own from here. Some workaround solutions I can think of; If you're using 4.1, downgrade (I read that 4.0 should work fine). Try loading the .p12 without the Android KeyChain API. Hope this helps, Michaël. Op 3/07/2013 10:43, Gruber, Florian schreef: > Hello, > I downloaded the 30 days test license of iText for Android and want to > test it with a prototype for digital signing pdfs with a *.p12 certificate. > Then I installed the *.p12 certificate correctly in the Android > Keychain, but when I want to sign a pdf I get a Nullpointer Exception > from the Spongy Castle API (enclosed the source code and the exception). > Exist any example code for Android because I didn´t find any? > regards, > Florian Gruber > > Siemens AG > Infrastructure & Cities Sector > Rail Systems Division > Information Technology > IC RL IT PLM WEB > Sieboldstr. 16 > 91052 Erlangen, Deutschland > Tel: +49 9131 7-22942 > _mailto:floriangruber@siemens.com_ > > Siemens Aktiengesellschaft: Vorsitzender des Aufsichtsrats: Gerhard > Cromme; Vorstand: Peter Löscher, Vorsitzender; Roland Busch, Brigitte > Ederer, Klaus Helmrich, Joe Kaeser, Barbara Kux, Hermann Requardt, > Siegfried Russwurm, Peter Y. Solmssen, Michael Süß; Sitz der > Gesellschaft: Berlin und München, Deutschland; Registergericht: Berlin > Charlottenburg, HRB 12300, München, HRB 6684; WEEE-Reg.-Nr. DE 23691322 > > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by Windows: > > Build for Windows Store. > > http://p.sf.net/sfu/windows-dev2dev > > > > _______________________________________________ > iText-questions mailing list > iText-questions@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/itext-questions > > iText(R) is a registered trademark of 1T3XT BVBA. > 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 > ------------------------------------------------------------------------------ This SF.net email is sponsored by Windows: Build for Windows Store. http://p.sf.net/sfu/windows-dev2dev _______________________________________________ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions iText(R) is a registered trademark of 1T3XT BVBA. 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 ------------------------------------------------------------------------------ This SF.net email is sponsored by Windows: Build for Windows Store. http://p.sf.net/sfu/windows-dev2dev _______________________________________________ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions iText(R) is a registered trademark of 1T3XT BVBA. 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