• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Store and load a RSA key pair

 
hossein arabi
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 225
Debian Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thank you so much
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic