• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Jeanne Boyarsky
  • Tim Cooke
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Mikalai Zaikin
  • Carey Brown
Bartenders:

case of "UnrecoverableKeyException: DER input, Integer tag error"?

 
Ranch Hand
Posts: 137
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a keystore object that I added a public key to, as follows:
storage.setKeyEntry("mypublickey" ,pubkey,"pubkeypassword".toCharArray(), null);
I then try to pull the public key back out with this line:
pubkey = (PublicKey)storage.getKey("mypublickey","pubkeypassword".toCharArray());
but the call throws an exception:
java.security.UnrecoverableKeyException: DER input, Integer tag error"
anyone know what causes this? i can get an enumeration of the aliases and list the key just fine, but cannot get it out of the keystore.
thanks,
jon
 
Jon Dornback
Ranch Hand
Posts: 137
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
after searching the net for hours, it turns out the problem is how the KeyStore is initialized. the java tutorial on the sun site says that the default provider should be fine, but it's not.

hope that saves someone some agony.
Jon
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


hope that saves someone some agony.
Jon[/QB]


GOD BLESS YOU JON!!!
I can pass one further tip on for using keystores...
Don't try and create one manually the first time. It don't work!
I got this from somewhere else on the web - here is my function for creating keystores - it basically invokes the keystore tool and then picks up the output.
You may have to edit it a little...
Again, hope it helps someone, like Jon helped me :-)

IM
(I edited the post to fix the typo involved in the code tags -- JAM)
[ August 25, 2003: Message edited by: Joel McNary ]
 
Bartender
Posts: 1844
Eclipse IDE Ruby Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to JavaRanch, Iain! We are glad that we could be of assistance, and thanks for the methods.
 
There's a way to do it better - find it. -Edison. A better tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic