Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / Security / December 2004

Tip: Looking for answers? Try searching our database.

java.io.IOException: DER input, Integer tag error

Thread view: 
Jason Friedman - 05 Dec 2004 14:55 GMT
I'm trying to import a PKCS12 certificate into a Keystore:

KeyStore keyStore = KeyStore.getInstance( "PKCS12" );
keyStore.load( new FileInputStream( "/tmp/client.p12" ), "changeit".toCharArray() );

This code yields the exception below:

Exception in thread "main" java.io.IOException: DER input, Integer tag error
    at sun.security.util.DerInputStream.getInteger(DerInputStream.java:151)
    at com.sun.net.ssl.internal.ssl.PKCS12KeyStore.engineLoad(PKCS12KeyStore.java:1195)
    at java.security.KeyStore.load(KeyStore.java:1150)

$ java -version
java version "1.5.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-b64)
Java HotSpot(TM) Client VM (build 1.5.0-b64, mixed mode, sharing)
jason@powerpull.net - 07 Dec 2004 06:42 GMT
I'm posting an answer to my own question. The problem was that the file
was not in .p12 format.

By the way, the openssl command is handy for converting certificates
from one format to another.

> I'm trying to import a PKCS12 certificate into a Keystore:
>
[quoted text clipped - 6 lines]
>     at sun.security.util.DerInputStream.getInteger(DerInputStream.java:151)
>     at
com.sun.net.ssl.internal.ssl.PKCS12KeyStore.engineLoad(PKCS12KeyStore.java:1195)
>     at java.security.KeyStore.load(KeyStore.java:1150)
>
> $ java -version
> java version "1.5.0"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-b64)
> Java HotSpot(TM) Client VM (build 1.5.0-b64, mixed mode, sharing)


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.