• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

PKCS12 - Different resutls on JDK1.4 and JDK 1.5 and above

 
Ranch Hand
Posts: 430
Android VI Editor Debian
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi guys, i've recieved a PKCS12 file which contains a certificate and private key that i am supposed to extract. As im new to certificates and the whole PKI infrastructure i attempted to write a small program to try and view the contents of the PKCS#12 file.

A password is required to retrieve the certificate and the private key from the pkcs12 file. A password was provided to me and the instructions state that the password is the MD5 hash of the password that was provided to me.

I am having two weid prolems with this implementation. If i run this class on a JDK1.5 VM the password is rejected with the following error.



I am not sure why it is insisting that the password should be ASCII. Does anyone know why this is the case?

If i run the same class on JDK 1.4, i can open the PKCS12 file so the password is accepted. as shown below



The exception in 1.4 is to do with this line i think



I havent found out the resolution to the above problem but im a bit worried on teh error if i ran it on 1.5. As i dont have control of the format of the password, i cant just change it to be an ASCII password. Is there a way i can get it to accept a non-ascii password?

Here are the classes i used to test the above.




Any help will be greatly appreciated.

[ July 06, 2008: Message edited by: O. Ziggy ]

[ July 06, 2008: Message edited by: O. Ziggy ]
[ July 06, 2008: Message edited by: O. Ziggy ]
 
Ranch Hand
Posts: 242
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Give it a try with Bouncy Castle pkcs12 KeyStore implementation. It might solve the problem.
 
reply
    Bookmark Topic Watch Topic
  • New Topic