This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Security and the fly likes InvalidKeyException: IOException : algid parse error, not a sequence Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » Security
Bookmark "InvalidKeyException: IOException : algid parse error, not a sequence" Watch "InvalidKeyException: IOException : algid parse error, not a sequence" New topic
Author

InvalidKeyException: IOException : algid parse error, not a sequence

Travis Thomas
Greenhorn

Joined: Mar 31, 2011
Posts: 9
I'm using some code grabbed off the Interwebs that should work, but I'm getting an exception... got the .der files from my boss, so I assume they're valid, but perhaps not. Spacing and returns are odd here but normal on my machine.

C:\Users\Trevor Basden\Desktop\ImportKey>java ImportKey AKMClientPrivKey.der AKM
ClientSignedCert.der password
Using keystore-file : C:\Users\Trevor Basden\Desktop\ImportKey\keyst2
HERE1
java.security.spec.InvalidKeySpecException: java.security.InvalidKeyException: I
OException : algid parse error, not a sequence
at sun.security.rsa.RSAKeyFactory.engineGeneratePrivate(Unknown Source)
at java.security.KeyFactory.generatePrivate(Unknown Source)
at ImportKey.main(ImportKey.java:257)
Caused by: java.security.InvalidKeyException: IOException : algid parse error, n
ot a sequence
at sun.security.pkcs.PKCS8Key.decode(Unknown Source)
at sun.security.pkcs.PKCS8Key.decode(Unknown Source)
at sun.security.rsa.RSAPrivateCrtKeyImpl.<init>(Unknown Source)
at sun.security.rsa.RSAPrivateCrtKeyImpl.newKey(Unknown Source)
at sun.security.rsa.RSAKeyFactory.generatePrivate(Unknown Source)
... 3 more
Greg Charles
Sheriff

Joined: Oct 01, 2001
Posts: 2841
    
  11

Hi Trevor,

Welcome to Java Ranch! I see you're not getting any responses to this question in I/O and Streams, so I'm going to move it over to Security where it might get some better traction. Good luck!

Greg
 
Consider Paul's rocket mass heater.
 
subject: InvalidKeyException: IOException : algid parse error, not a sequence
 
Similar Threads
java program to add digital signature into a pdf file
how do i programmatically create a keystore and import my certificate into it?
PFX file not getting imported into keystore
using bouncy castle jce provider??
CXF keystore question