Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Import Key Pair(public/private)

 
kamal palia
Greenhorn
Posts: 17
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have generated key pair into cacerts using keytool -genkey command and its generated successfuly.
Now i have to import same key pair with same alias name into another cacerts so how can i do this?
 
kamal palia
Greenhorn
Posts: 17
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I got the command for copying key pair from one keystore to another keystore given below

C:\>keytool -import -keystore D:\key\keystore.jks -keystore D:\key\Server\keysstore.jks -storepass password -storepass password -alias merchantkey -alias merchantkey -keypass password -keypass password


but it is giving error
keytool error: java.lang.Exception: Input not an X.509 certificate

any idea?
 
Richard Tookey
Bartender
Pie
Posts: 1166
17
Java Linux Netbeans IDE
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
kamal palia wrote:
any idea?


That looks very very wrong! You need to look at the 'keytool' documentation.
 
kamal palia
Greenhorn
Posts: 17
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have two different application servers and generated key pair in one server and shared public key with client.
Now whenever client will send some encrypted data loadbalancer will try to send request to any one of the server, which means in both server private key should be available so for this purpose, i need to copy key pair from one app server jks file to another app server jks file.
So what's wrong in this?
 
Richard Tookey
Bartender
Pie
Posts: 1166
17
Java Linux Netbeans IDE
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
kamal palia wrote:
So what's wrong in this?


I was not indicating that your concept is flawed, though I do have reservations, only that the command line you are using is very very wrong and that you need to read the 'keytool' documentation. What is to stop you copying the whole 'cacerts' file from one machine to the other?


P.S. I do hope you are getting a CA to generate signed certificates or you are going to have two unauthenticated to each other and unknown to each other parties communicating very very securely.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic