This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
The moose likes Security and the fly likes sequence wrong size for a certificate Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Engineering » Security
Bookmark "sequence wrong size for a certificate" Watch "sequence wrong size for a certificate" New topic
Author

sequence wrong size for a certificate

Akram Chotu
Ranch Hand

Joined: Apr 18, 2006
Posts: 43
I am using below lines of code to convert a .cer file to its encoded format (not base64 encoded) :




However when I try the reverse process of converting back to .cer file using below code:




then I am getting error like
java.security.cert.CertificateException: java.lang.IllegalArgumentException: sequence wrong size for a certificate


I tried with Sun's default JCE Provider but not avail. Any thoughts?


Thanks.
greg stark
Ranch Hand

Joined: Aug 10, 2006
Posts: 220
You have clearly not stored a certificate in my_binary.cer but rather only the public key. You should change the line to


Nice to meet you.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: sequence wrong size for a certificate
 
Similar Threads
InvalidKeyException: IOException : algid parse error, not a sequence
Help with OCSP Stand Alone Implementation
SSLHandshakeException
how to generate x.509 certificate?
how do i programmatically create a keystore and import my certificate into it?