Problems while generating java keystore while using the extension decentralized-identity with vault-filesystem #3022
-
I am investigating decentralized-identity extension https://github.com/eclipse-edc/Connector/tree/main/extensions/common/iam/decentralized-identity I am also using vault-filesystem extension to load private and public keys that will be placed in the Java Key Store. The private key will be used to sign JWT that will be sent to the provider. Now I am facing an issue. I have tried to generate Elliptic Curve Private and Public keys. After this, I generated certificate and created a Java Key Store (JKS) with this same private key and certificate. I have used the following commands to generate a keystore:
Now the problem is that when I try to export private key that was generated using first command from the Java Keystore, the exported key does not match the actual private key due to which I am getting some errors and the code fails while parisng the keys.
I have also used KeyStore Explorer Tool to confirm this. When I open my java keystore in Keystore Explorer and try to export the private key after selecting "OpenSSL" as the Export Private Key Option as can be seen in the below image, the private key that I exported is not equal to the private key that was generated in the beginning There is also a keystore https://github.com/eclipse-edc/Connector/blob/main/extensions/common/vault/vault-filesystem/src/test/resources/edc-test-keystore.jks that has been already created for test cases in this project. For that Java Keystore the test cases are working fine. Can anyone tell me what I am doing wrong and how I can generate a java keystore. What steps did you follow to create it? I have already invested a lot of time figuring out this problem and could not find asolution yet. Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Finally, I have solved the problem. Instead of using the commands, in the end I had to generate keypairs using Keystore Explorer and now things are working. Now my private key loads successfully in my application. Still could not figure out why the loaded key does not match the actual private key if I create java keystore (.jks) using the above commands but anyway I have found another way to fix it |
Beta Was this translation helpful? Give feedback.
Finally, I have solved the problem. Instead of using the commands, in the end I had to generate keypairs using Keystore Explorer and now things are working. Now my private key loads successfully in my application. Still could not figure out why the loaded key does not match the actual private key if I create java keystore (.jks) using the above commands but anyway I have found another way to fix it
.