f



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
manglu (8)
9/10/2005 10:24:28 AM
comp.lang.java.security 1502 articles. 0 followers. Post Follow

2 Replies
7245 Views

Similar Articles

[PageSpeed] 1

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
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
Mangalaganesh
9/12/2005 8:35:38 AM
Reply:

Similar Artilces:

java.io.IOException: DerInputStream.getLength(): lengthTag=109, too big.
can anyone please tell me why am i getting such an error when i specify my KeyStore path to the FileInputStream.. <josephjelsy@gmail.com> wrote in message news:1144677343.279016.123840@i40g2000cwc.googlegroups.com... > can anyone please tell me why am i getting such an error when i specify > my KeyStore path to the FileInputStream.. I googled for "DerInputStream", and the first hit I saw looks like it might be relevant to your error. http://www.codecomments.com/archive253-2004-4-173117.html - Oliver ...

java.lang.ExceptionInInitializerError: java.lang.ArrayIndexOutOfBoundsException
Hi, I am new to DB2. I am getting this error while loading the DB2Driver. I don't have any idea about where i might have gone wrong. please help me. Below is the stack trace. Stack Trace: java.lang.ExceptionInInitializerError: java.lang.ArrayIndexOutOfBoundsException at COM.ibm.db2.jdbc.app.DB2Driver.SQLAllocEnv(Native Method) at COM.ibm.db2.jdbc.app.DB2Driver.<init>(DB2Driver.java:245) at COM.ibm.db2.jdbc.app.DB2Driver.<clinit>(DB2Driver.java:130) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Cla...

java.lang.StringIndexOutOfBoundsException: String index out of range: 23 at java.lang.String.charAt(String.java:460)
Hi All I am having the torque3.1.jar and postgresql-7.4. I have compiled the new jdbc driver called as postgresql.jar and have placed it in the lib directory from where the ant scripts catch the jars. Whenever i try to access through torque gestList = BaseGestlistPeer.doSelect(new Criteria()); this error arises java.lang.StringIndexOutOfBoundsException: String index out of range: 23 at java.lang.String.charAt(String.java:460) at org.postgresql.jdbc2.ResultSet.toTimestamp(ResultSet.java:1653) at org.postgresql.jdbc2.ResultSet.getTimestamp(ResultSet.java...

Big txt file
When I tried to open a big text file in matlab 7.9.0(R2009b) I have this error. How can I solve this problem Exception in thread "AWT-EventQueue-0" java.lang.OutOfMemoryError: Java heap space at sun.font.GlyphList.ensureCapacity(Unknown Source) at sun.font.GlyphList.setFromChars(Unknown Source) at sun.java2d.pipe.GlyphListPipe.drawChars(Unknown Source) at sun.java2d.SunGraphics2D.drawChars(Unknown Source) at org.netbeans.editor.DrawGraphics$GraphicsDG.flush(DrawGraphics.java:633) at org.netbeans.editor.DrawGraphics$GraphicsDG.flush(DrawGraphics.java:522) at org.netbeans.edito...

java.lang.Set with elements of type java.lang.Set
Roughly I do something along the lines of: Set set = new HashSet(); Set elem = new HashSet(); set.add(elem); // now we change the elem and add it again to the set elem.add(some object here); set.add(elem); I found out the hard way that 'set' may now contain 'elem' either once or twice, the reason being that 'elem.add()' changes the hashCode of elem such that it is not noticed that it is in 'set' already on the 2nd 'set.add()'. Question: What I would actually want is an IdentityHashSet() set = new IdentityHashSet() but this does not...

java.security.acl.Permission vs java.security.Permission
Hi Interfaces in java.security.acl package accept java.security.acl.Permission interface as their parameters, not java.security.Permission. Why is it so? Why there are two different Permissions which are seem to be related, and can be one. Amir Pashazadeh ...

to use import java.lang.* or import java.lang.Math or none at all?
Hi guys, i knew that by default all java.lang classes will be imported by the compiler during compilation. but, to make it easier for the computer, should i specify which class i really will be using? does this action will boost the performance during compilation and runtime or not a matter at all? the answer to this post will definitely affect my programming style in the future when i'm considering "to import or not to import"... hmm,,, thanks in advance. JPractitioner wrote: > i knew that by default all java.lang classes will be imported by the > compiler during com...

Error occurred during initialization of VM java/lang/NoClassDefFoundError: java/lang/Object
I downloaded jdk-6u7-solaris-sparcv9.tar.Z and installed it by these commands: # zcat jdk-6u7-solaris-sparc.tar.Z | tar -xf - # pkgadd -d . SUNWj6rtx SUNWj6dvx SUNWj6dmx # /usr/jdk/instances/jdk1.6.0/bin/sparcv9/java -version Error occurred during initialization of VM java/lang/NoClassDefFoundError: java/lang/Object # ls /usr/jdk/instances/ jdk1.5.0 jdk1.6.0 # uname -a SunOS sun1 5.10 Generic sun4u sparc SUNW,Sun-Blade-2500 Please help to fix the error. Thanks. TsanChung wrote: > I downloaded jdk-6u7-solaris-sparcv9.tar.Z and installed it by these > commands: > # zcat jdk-6u7-so...

Error occurred during intialization of VM java/lang/NoClassDefFoundError: java/lang/Object
Good day to all, I have installed the j2se/netbeans binary bundle on red hat 9. I can run everything perfectly as root but when I try to compile with any other user I get: Error occurred during intialization of VM java/lang/NoClassDefFoundError: java/lang/Object When I saw this it seemed like a permissions problem but I checked the permissions and everything seemed fine. All users have execute permissions of javac and java. I have read other threads dealing with the same or similar problem but have not reached any solution yet. I would appreciate if anyone that has run into this type o...

CheckBox in Column of JTable: Exception: java.lang.String cannot be cast to java.lang.Boolean
Hello, I have discovered a hidden error. My project was working for awhile, but then I started to get the below error. My error comes from the fact that I'm using a checkbox in a jtable, and I'm using the below "getColumnClass". Thank you, compile: run: Exception in thread "AWT-EventQueue-0" java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Boolean at javax.swing.JTable$BooleanRenderer.getTableCellRendererComponent(JTable.java:5412) at javax.swing.JTable.prepareRenderer(JTable.java:5735) at javax.swing.plaf.basic.BasicTableU...

java.lang.NoClassDefFoundError: java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory
Hi, I'm trying to use the httpclient within Jython (see http://jakarta.apache.org/commons/httpclient/ for more information on the httpclient). My Jython version is: Jython 2.1 on java1.4.2_04 (JIT: null) My Java version is: java version "1.4.2_04" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) My CLASSPATH includes: jdom.jar xerces.jar jython.jar jt400.jar log4j-1.2.8.jar commons-httpclient-2.0.jar When I just try to perform the import statements from example code I get the error pasted below....

Error occurred during initialization of VM java/lang/NoClassDefFoundError: java/lang/Object (ant/tomcat/spring)
Hi, I've been trying to get Spring working with ant and tomcat. Ant was building just fine, but I came in today and tried to build it and got this: Error occurred during initialization of VM java/lang/NoClassDefFoundError: java/lang/Object ?!?! Makes no sense to me. There _is_ an older version of java installed on my machine; but JAVA_HOME and ANT_HOME are set to the correct paths, and <which java>and <java -version> produce the correct version. Any help would greatly alleviate my frustration! Thanks in advance... Courtney ...

Error occurred during initialization of VM java/lang/NoClassDefFoundError: java/lang/Object (ant/tomcat/spring)
Hi, I've been trying to get Spring working with ant and tomcat. Ant was building just fine, but I came in today and tried to build it and got this: Error occurred during initialization of VM java/lang/NoClassDefFoundError: java/lang/Object ?!?! Makes no sense to me. There _is_ an older version of java installed on my machine; but JAVA_HOME and ANT_HOME are set to the correct paths, and <which java>and <java -version> produce the correct version. Any help would greatly alleviate my frustration! Thanks in advance... Courtney ...

SSRT3627 Security Bulletin Rev.1
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 ----------------------------------------------------------------- **REVISED 01** Source: HEWLETT-PACKARD COMPANY SECURITY BULLETIN: HPSBUX0309-280 Originally issued: 15 Sept. 2003 Last revised: 17 Oct. 2003 SSRT3627 Potential Sec. Vulnerability in Java VM (J2SE) and Java Secure Socket Extension (JSSE) (Rev. 1) ----------------------------------------------------------------- NOTICE: There are no restrictions for distribution of this Bulletin provided that it remains complete and intact. The information in the following Security Bulle...

Web resources about - lengthTag=109, too big. - comp.lang.java.security

Resources last updated: 2/4/2016 11:35:02 AM