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!

Length Tag=109, too big

843811Sep 10 2005 — edited Sep 10 2005
Hi,

I created a certificate using java keytool (JDK 1.4.2 )

No matter which proivder i use (IBMJCE or BouncyCastle to name a couple)

I keep getting this error.

public X509Certificate getCertificate() {
try {

InputStream inStream = new FileInputStream(SERVER_KEYSTORE);
CertificateFactory cf = CertificateFactory.getInstance("X.509");

X509Certificate cert = (X509Certificate) cf.generateCertificate(inStream);
inStream.close();
return cert;
}
catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
throw new RuntimeException(e);
}
}


java.security.cert.CertificateException: Unable to initialize, java.io.IOException: DerInputStream.getLength(): lengthTag=109, too big.
at com.ibm.security.x509.X509CertImpl.<init>(Unknown Source)
at com.ibm.security.x509.X509CertImpl.<init>(Unknown Source)
at com.ibm.crypto.provider.X509Factory.engineGenerateCertificate(Unknown Source)
at java.security.cert.CertificateFactory.generateCertificate(Unknown Source)
at samples.EncyrptionSamples.getCertificate(EncyrptionSamples.java:113)
at samples.EncyrptionSamples.encrypt(EncyrptionSamples.java:91)
at samples.EncyrptionSamples.main(EncyrptionSamples.java:62)

Appreciate if somebody could point me to what is wrong out here.

Thanks,
manglu
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 8 2005
Added on Sep 10 2005
1 comment
5,014 views