I have a JKS keystore without a storepass, which contains a private key without a keypass.
- I can't use this store and this key to interactively sign using e.g.
jarsigner
(which does not allow for empty keypass), - and all automation fails either by demanding a storepass or a keypass or both.
But the private key is in the keystore.
All my attempts at extracting the key using keytool
have failed, and all attempts to password protect the key or the keystore have failed as well, all owing to the passlessness. The same goes for GUI and other tools that manipulate keystores. I'm guessing this is because a keypassless key in a storepassless store isn't a supported scenario anymore, or perhaps never was.
But I'm guessing there's code in the java.security.KeyStore
namespace or elsewhere that lets me export the private key using Java code. Does anyone know for sure, and if so, could point me in the right direction, since I have zero experience with this?