|
|
lengthTag=109, too big.
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
|
|
0
|
|
|
|
Reply
|
manglu (5)
|
9/10/2005 10:24:28 AM |
|
Hi,
What is the 'SERVER_KEYSTORE'? You cannot pass in the whole key store
into the certificate factory. It must be your DER- or base64 encoded
certificate.
If it doesn't help, then please reply with your certificate (base 64
encoded) and I can check it through an ASN.1 viewer.
Regards,
Tommy Gr=E4ndefors
www.pheox.com
Mangalaganesh Balasubramanian wrote:
> 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 =3D new FileInputStream(SERVER_KEYSTORE);
> CertificateFactory cf =3D CertificateFactory.getInstance("X.509");
>
> X509Certificate cert =3D (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=3D109, 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.
>=20
> Thanks,
> manglu
|
|
0
|
|
|
|
Reply
|
iso
|
9/11/2005 9:52:55 AM
|
|
Tommy,
Thanks for you reply.
The Server_Keystore is a jks file.
Instead of passing a keystore if i just pass the certificate (a .cer
file) then it is able to work.
Thanks,
manglu
|
|
0
|
|
|
|
Reply
|
Mangalaganesh
|
9/12/2005 8:35:38 AM
|
|
|
2 Replies
1781 Views
(page loaded in 0.103 seconds)
Similiar Articles: lengthTag=109, too big. - comp.lang.java.securityHi, 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... java.io.IOException: DER input, Integer tag error - comp.lang.java ...java.io.InputStream converting bytes - comp.lang.java.help ..... first convert the PEM encoded String to a byte array and then PEM decode the ... lengthTag=109, too big ... Getting some serial numbers in java - comp.lang.java.help ...lengthTag=109, too big. - comp.lang.java.security Getting some serial numbers in java - comp.lang.java.help ... CertificateException DerInputStream.getLength lengthTag=127 ... Why a invalid keystore format exception? - comp.lang.java.security ...lengthTag=109, too big. - comp.lang.java.security The Server_Keystore is a jks file. Instead of ... "Invalid encoding for signature" exception - comp.lang.java ... Java and X509 Certificates .. help!! - comp.lang.java.security ...lengthTag=109, too big. - comp.lang.java.security JavaScript and X509 Certificates .. help !! - comp.lang.javascript ... lengthTag=109, too big. - comp.lang.java.security ... Verification of digital signature, generated on .NET platform ...lengthTag=109, too big. - comp.lang.java.security COMPGROUPS.NET | Search ... lengthTag=109, too big. - comp.lang.java.security Verification of digital signature ... lengthTag=109, too big. - Application Forum at ObjectMix.comHi, 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 JAVA • View topic • lengthTag=109, too big.lengthTag=109, too big. Programming and Web Development Forums - JAVA - Security issues raised by Java. Skip to content 7/20/2012 5:01:09 PM
|
|
|
|
|
|
|
|
|