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!

Problem on importing certificate to *.jks file

843811Mar 15 2007 — edited Dec 8 2008
Hi,

I done the initial steps to create a certificate. Sent it to CA to authorized it and got it sent back. Anyway, when i tried to import the *.crt file i received into the *.jks file, i received the below error.

java.io.EOFException
at java.io.DataInputStream.readFully(Unknown Source)
at java.io.DataInputStream.readFully(Unknown Source)
at sun.security.util.DerValue.init(Unknown Source)
at sun.security.util.DerValue.<init>(Unknown Source)
at sun.security.provider.X509Factory.parseX509orPKCS7Cert(Unknown Source)
at sun.security.provider.X509Factory.engineGenerateCertificates(Unknown Source)
at java.security.cert.CertificateFactory.generateCertificates(Unknown Source)
at sun.security.tools.KeyTool.installReply(Unknown Source)
at sun.security.tools.KeyTool.doCommands(Unknown Source)
at sun.security.tools.KeyTool.run(Unknown Source)
at sun.security.tools.KeyTool.main(Unknown Source)
keytool error: java.security.cert.CertificateException

The command i type is also as below:

keytool -import -keystore mydomain.jks -alias mydomain.com -file mycertificate.crt

Hope that someone can help.

Btw, I do have another problem that i need some help also. Anyone done before trying to install a certificate (*.cer) imported from IIS and to install into a Java generic web server? Any clue? Thanks again.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 5 2009
Added on Mar 15 2007
9 comments
3,002 views