wood burning stoves 2.0*
The moose likes Sockets and Internet Protocols and the fly likes Store and load a RSA key pair Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "Store and load a RSA key pair" Watch "Store and load a RSA key pair" New topic
Author

Store and load a RSA key pair

hossein arabi
Greenhorn

Joined: Jan 15, 2009
Posts: 20
Dear all,
can anyone show me how to store and load a RSA key pair so when ever I need the pair I just load them for encryption.
thank you very much

Carey Evans
Ranch Hand

Joined: May 27, 2008
Posts: 225

A KeyStore can store and retrieve entries containing an RSA private key and a certificate with the public key. This is the preferred way to do it, because you can manipulate the keys with keytool, or use a PKCS#12 key store with other tools; and you can use the keys with SSL via a KeyManagerFactory.

If you just have an RSA public key, you can generate a certificate based on it using the Bouncy Castle X509V3CertificateGenerator.
hossein arabi
Greenhorn

Joined: Jan 15, 2009
Posts: 20
thank you so much
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Store and load a RSA key pair