File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Playing with KeyPair

 
Mike Litherland
Ranch Hand
Posts: 31
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have java.security.KeyPairGenerator making RSA KeyPairs for me, but I'm not sure what to do with the encoded data. On my public and private keys I call the getEncoded() method, which returns a binary representation of the key, but how can I turn the binary representation back into a key object? I've been poking around the documentation for about a day without any luck.

Thanks,
Mike

Edit: More generally, if someone knows of a tutorial about working with KeyPairs in java other than the sun standard ones, it would be appreciated. Figuring stuff out from google snippets and API docs isn't exactly fun.

[ November 14, 2005: Message edited by: M Litherland ]

Edit 2: I found an example of getting the key pair back from the encoding here: http://javaalmanac.com/egs/java.security/GetKeyPairBytes.html?l=rel
[ November 14, 2005: Message edited by: M Litherland ]
 
summer summer
Greenhorn
Posts: 1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I used to translate .net key file to java key file.
You could learn a lot from this Example

 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic