f



CertificateException DerInputStream.getLength lengthTag=127 too big

Hi All,

I am getting a valid PEM encoded cert issued by a CA and then use IE
Xenroll to install it into the browser. All these work well.
Now in between, I try to get the serial number out of the cert which
is where it fails.

1. I first convert the PEM encoded String to a byte array and then PEM
decode the byte array. Then I pass this byte array to X509Certificate
getInstance method which throws the Certificate exception saying
DerInputStream.getLength lengthTag=127 too big
Has anybody faced this problem? 

2. I am pretty sure the PEM encoded certificate is alright because I
can install it on the browser after wrapping it with BEGIN CERTIFICATE
and END CERTIFICATE. Is there any other way I can programmatically get
the certificate serial number from teh PEM encoded Certificate String.

Thanks in advance for your help.
-Yash
0
iamr00t1974
1/14/2004 4:32:01 AM
comp.lang.java.security 1502 articles. 0 followers. Post Follow

2 Replies
4743 Views

Similar Articles

[PageSpeed] 59

> 1. I first convert the PEM encoded String to a byte array and then PEM
> decode the byte array. Then I pass this byte array to X509Certificate
> getInstance method which throws the Certificate exception saying
> DerInputStream.getLength lengthTag=127 too big
> Has anybody faced this problem? 

Seems you're using an old javax.security.cert.Certificate class. Use
java.security.cert.CertifcateFactory instead and see if you get the
same error. 

-Hans
0
hgranqvistx
1/14/2004 10:35:42 PM
Thanks, Hans.
I suspect that the certificate is in base64 CMC encoded certificate.
None of the OpenSSL utilites was able to parse this certificate as it
seems to be a propriety Microsoft format. Do you have any idea if
there are any tools or utilites which can be used to programmatically
extract the serial number from such certificates.?


hgranqvistx-google@yahoo.com (Hans Granqvist) wrote in message news:<f2c05086.0401141435.35f3b137@posting.google.com>...
> > 1. I first convert the PEM encoded String to a byte array and then PEM
> > decode the byte array. Then I pass this byte array to X509Certificate
> > getInstance method which throws the Certificate exception saying
> > DerInputStream.getLength lengthTag=127 too big
> > Has anybody faced this problem? 
> 
> Seems you're using an old javax.security.cert.Certificate class. Use
> java.security.cert.CertifcateFactory instead and see if you get the
> same error. 
> 
> -Hans
0
iamr00t1974
1/15/2004 5:24:56 PM
Reply:

Similar Artilces:

DerInputStream.getLength(): lengthTag=127, too big. / CertificateFactory
Hi all... I need some help for certificate. I currently develop a project for my job and we use certificate authentification. So I generate a PKCS10 from IE( Xenroll.createPKCS10 ). I send it to a CA who deliver me a CertificateChain. I can import it with Xenroll.acceptPKCS7. The certchain is good... But i need to make some Operation in Java and try to use certificateFactory.getCertificate() to have an X509Certificate Object but i have this : ERROR --> DerInputStream.getLength(): lengthTag=127, too big. ByteArrayInputStream bis = new ByteArrayInputStream( certificat.getBytes() ); Cer...

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 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? Whether and how you import classes has exactly zero effect at runtime. Imports (with or without wildcards) are only a kind of abbreviation provided by the compiler to save us the effort of typing in fully-qualified type names every time. In theory explicit importing should make compilation faster -- by a very tiny amount. I've never heard anyone claim that they've even managed to measure a difference let alone found a case where it made a practical difference. So the question comes down to how to write your code for maximum clarity. One school of thought asserts that you should always import each class explicitly (rather than by a wildcard). There's a fai...

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...

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...

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 ...

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...

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 ...

java.security.cert.CertificateException: Could not find trusted certificate
I was asked to do a little command line program that will make sure a server is up and listening on a port. I need to send it a little transaction and print out the reply. It's an https:// connection, and I'm getting "java.security.cert.CertificateException: Could not find trusted certificate" On Redhat 8, Mozilla and Konqueror both complain that the certificate signing authority is unknown or invalid. It is a Verisign certificate, but it does appear to be slightly different, it comes from "Verisign International Server CA - Class 3". IE on WinXP does n...

java.security.cert.CertificateException: Could not find trusted certificate #2
When I try to access some resourse on my web server through HTTPs it through the following exception . java.security.cert.CertificateException: Could not find trusted certificate Any information on this would be highly helpful. Thanks Trilochan Trilochan wrote: > When I try to access some resourse on my web server through HTTPs it > through the following exception . > > java.security.cert.CertificateException: Could not find trusted > certificate > > Any information on this would be highly helpful. > > Thanks > Trilochan It means that the CA which signed the server certificate is unknown to the application. You either have to import it on the client or have the server support staff have their cert signed by a recognized authority like Thawte et al. ...

modifying java.lang.String.java
Hi, I'm trying to modify java.lang.String.java and add the modified String.class to rt.jar [THIS IS FOR MYSELF ONLY AND WILL NOT BE DEPLOYED]. I cannot add "private final boolean tainted[] = new boolean[5];" to String.java. If I do, it still compiles and I can add it to rt.jar and compile a test program against it. However, the JVM crashes with a strange message: java.lang.IllegalArgumentException: name can't be empty at java.security.BasicPermission.init(Unknown Source) at java.security.BasicPermission.<init>(Unknown Source) at java....

java.lang vs java.util
Surprising to see something defined in java.lang <http://developer.android.com/reference/java/lang/Iterable.html> depend on something defined in java.util <http://developer.android.com/reference/java/util/Iterator.html>. Surely the hierarchy should go the other way? On 4/1/2011 9:11 PM, Lawrence D'Oliveiro wrote: > Surprising to see something defined in java.lang > <http://developer.android.com/reference/java/lang/Iterable.html> depend on > something defined in java.util > <http://developer.android.com/reference/java/util/Iterator.html>. > > Surely the hierarchy should go the other way? I think Iterable may make it into java.lang because of its significance in the foreach statement. Patricia On 04/02/2011 12:23 AM, Patricia Shanahan wrote: > On 4/1/2011 9:11 PM, Lawrence D'Oliveiro wrote: >> Surprising to see something defined in java.lang >> <http://developer.android.com/reference/java/lang/Iterable.html> depend on >> something defined in java.util >> <http://developer.android.com/reference/java/util/Iterator.html>. >> >> Surely the hierarchy should go the other way? Not if it wants to be consistent with http://download.oracle.com/javase/6/docs/api/ don't'cha think? And the so-called "hierarchy" of java.util and java.lang is that they are equal. The language reserves for itself the entire panoply of java.* and javax.* packages. > I think It...

GIDS 2009 Java:: Save Big, Win Big, Learn Big: Act Before Dec 29 2008
------------------------------------------------------------------- :::: Great Indian Developer Summit 2009 - GIDS.Java :::: :::: 24 April 2009 :::: :::: J N Tata Auditorium, IISc, Bangalore :::: :::: http://www.developersummit.com :::: ------------------------------------------------------------------- Dear Group members, The economic downturn will run out of steam trying to outdo the 'ready and waiting' software professional. Packed with premium knowledge, action plans and advise from been-there-done-it veterans, creators, and visionaries, the 2009 edition of Great Indian Developer...

GIDS 2009 Java:: Save Big, Win Big, Learn Big: Act Before Dec 29 2008
------------------------------------------------------------------- :::: Great Indian Developer Summit 2009 - GIDS.Java :::: :::: 24 April 2009 :::: :::: J N Tata Auditorium, IISc, Bangalore :::: :::: http://www.developersummit.com :::: ------------------------------------------------------------------- Dear Group members, The economic downturn will run out of steam trying to outdo the 'ready and waiting' software professional. Packed with premium knowledge, action plans and advise from been-there-done-it veterans, creators, and visionaries, the 2009 edition of Great Indi...

GIDS 2009 Java:: Save Big, Win Big, Learn Big: Act Before Dec 29 2008
------------------------------------------------------------------- :::: Great Indian Developer Summit 2009 - GIDS.Java :::: :::: 24 April 2009 :::: :::: J N Tata Auditorium, IISc, Bangalore :::: :::: http://www.developersummit.com :::: ------------------------------------------------------------------- Dear Group members, The economic downturn will run out of steam trying to outdo the 'ready and waiting' software professional. Packed with premium knowledge, action plans and advise from been-there-done-it veterans, creators, and visionaries, the 2009 edition of Great Indian Developer...

GIDS 2009 Java:: Save Big, Win Big, Learn Big: Act Before Dec 29 2008
------------------------------------------------------------------- :::: Great Indian Developer Summit 2009 - GIDS.Java :::: :::: 24 April 2009 :::: :::: J N Tata Auditorium, IISc, Bangalore :::: :::: http://www.developersummit.com :::: ------------------------------------------------------------------- Dear Group members, The economic downturn will run out of steam trying to outdo the 'ready and waiting' software professional. Packed with premium knowledge, action plans and advise from been-there-done-it veterans, creators, and visionaries, the 2009 edition of Great Indian Developer...

GIDS 2009 Java:: Save Big, Win Big, Learn Big: Act Before Dec 29 2008
------------------------------------------------------------------- :::: Great Indian Developer Summit 2009 - GIDS.Java :::: :::: 24 April 2009 :::: :::: J N Tata Auditorium, IISc, Bangalore :::: :::: http://www.developersummit.com :::: ------------------------------------------------------------------- Dear Group members, The economic downturn will run out of steam trying to outdo the 'ready and waiting' software professional. Packed with premium knowledge, action plans and advise from been-there-done-it veterans, creators, and visionaries, the 2009 edition of Great Indian Developer...

Web resources about - CertificateException DerInputStream.getLength lengthTag=127 too big - comp.lang.java.security

Oracle effectively says Google jumped gun with Supreme Court petition in Android-Java copyright case
... Java APIs, such as this example cited by Oracle in its brief: public abstract void verify (PublicKey key, String sigProvider) throws CertificateException, ...

Researchers Expose SSL Vulnerabilities in Libraries and Their Usage in Popular Non-Browser Services
A recent publication in the ACM CCS'12 proceedings titled "The Most Dangerous Code in the World:Validating SSL Certificates in Non-Browser Software" ...

Resources last updated: 2/22/2016 2:59:24 AM