I've created a keystore with an initial key-pair using keytool -genkeypair
command, then generated the CSR using keytool -certreg
command, then got it signed by our CA. Now that I got the CSR reply myCSRreply.cer
, how do I incorporate the CSR reply with my original key-pair?
I've tried simply importing the CSR reply to my keystore using keytool -import
command but that did not change my original key-pair. It simply added the CSR reply as another entry. I'm expecting it to change the issuer and thumbprint of my original key-pair.
I'm able to do what I want to achieve via KeyStore explorer as shown in the following screenshot but I need to know how to do this in command line.
If I tried importing where I specify the CSR reply file and the alias to my original key-pair, I'm getting the following error.
keytool error: java.lang.Exception: Failed to establish chain from
reply
The command I used to import CSR back into my key-pair that generated that error:
keytool -keystore myKeyStore.pfx -importcert -file myCSRreply.cer -alias mykeypair
Question
- How do I import the
CSR reply
back into my key-pair via command line such that it's going to take the thumbprint and the issuer of theCSR reply
as the new attributes of my original key-pair? (I'm just assuming this is the expected outcome because when I generate JWT using the private key that takes its thumbprint, authentication fails) - Is
CSR reply
really meant to alter the thumbprint and issuer attributes of the key-pair in which theCSR
was generated from?