Skip to Main Content

Java Security

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

toDerInputStream rejects tag type 2

843811Dec 3 2001 — edited Jan 11 2008
Hi!

I'm making a system based on a C/C++ server and a Java client talking SSL to eachother. On the server, I'm using OpenSSL, and JSSE on the client (Suns implementation). We have a CA on the server, made also with OpenSSL. I have made certificates for the server and client using this. The problem comes when I call this line of code:
ks.load(new FileInputStream(filename), passphrase.toCharArray());
... where
filename
is the name of the client-certificate (pkcs12), and
passphrase
is a String with the (correct) passphrase. The Exception I get is:
java.io.IOException: toDerInputStream rejects tag type 2
at com.sun.net.ssl.internal.ssl.DerValue.toDerInputStream([DashoPro-V1.2-120198])
at com.sun.net.ssl.internal.ssl.MacData.<init>([DashoPro-V1.2-120198])
at com.sun.net.ssl.internal.ssl.PKCS12KeyStore.engineLoad([DashoPro-V1.2-120198])
at java.security.KeyStore.load(Unknown Source)
at ssl.SSLConnection.addKey(SSLConnection.java:156)
...
I know this or simular problems have been written about in here before, but I can't find anyone coming up with a good answer, so I guess it's a long shot asking again, but I give it a try. If no one knows the full answer, maybe someone knows "part answers":

What is toDerInputStream? What does it do?

What are these tags? Are they a part of the pkcs12 format? What is a tag type 2?

I've heard JSSE doesn't support newer versions of pkcs12, is this true? If so, will this change in the future? Could that be my problem here? If so, is there any way around it, if OpenSSL just supports the new format for instance?

I really hope someone can help, I've not found any useful information on the net, so this is more or less my last chance.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 8 2008
Added on Dec 3 2001
6 comments
4,870 views