In our project client asked me to upload certificate (*.pfx) into a servlet and then import that stream to java keystore file.
From JSP to servlet i am getting certificate information and i am getting ByteArrayInputstream, but when i try to import this to keystore by using KeyStore source = KeyStore.getInstance("PKCS12"); source.load(ByteArrayInputstream, pkcs12Password.toCharArray());
But i am always getting
java.io.IOException: DerInputStream.getLength(): lengthTag=127, too big. at sun.security.util.DerInputStream.getLength(Unknown Source) at sun.security.util.DerValue.init(Unknown Source) at sun.security.util.DerValue.<init>(Unknown Source) at com.sun.net.ssl.internal.pkcs12.PKCS12KeyStore.engineLoad(Unknown Source) at java.security.KeyStore.load(Unknown Source)
Any suggestion or help for this one.
Dhananjayan Karnam<br /> <br />SCJP, SCWCD
We must storm this mad man's lab and destroy his villanous bomb! Are you with me tiny ad?