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 Java in General and the fly likes Generating Public and Private keys. 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 » Java » Java in General
Bookmark "Generating Public and Private keys." Watch "Generating Public and Private keys." New topic
Author

Generating Public and Private keys.

Am SH
Greenhorn

Joined: Jan 26, 2004
Posts: 1
Hi All,
I want to generate PublicKey and PrivateKey pairs in my java program and distribute the public key. How do I convert the PublicKey into a String ?
I can convert it into a byte array, but not able to extract a string value.
Further, how do I obtain the PrivateKey object back from the Supplied string.
Some code snippets will be really helpful.
Thank you.
Cheers,
Amit.
Vijay Pandey
Ranch Hand

Joined: Feb 20, 2002
Posts: 39
hope i inderstodd your problem...if you can get a byte array simply construct a string out of this byte array..see the various String constructors..


Vijay Pandey<br />-----------------------------------<br />SCJP,OCP 8i DBA,OCP 9i DBA,<br />SCBCD,OOAD with UML (486), PMP, SCEA, SCWCD
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Generating Public and Private keys.
 
Similar Threads
how to cnecrypt password and stored in database
How to store PublicKey and PrivateKey in database??
RSA key retrieval from String representation
How to store PublicKey and PrivateKey in database??
convert String data as PublicKey or PrivateKey