Yesterday, I was trying to pull a shared secret (a `SecretKeyEntry` not a `PrivateKeyEntry`) out of a Java keystore.
I'd created it quite some time ago and annoyingly didn't have a copy of the secret stored anywhere. What I did have, however, was the `keystorepass` and the `keypass`, so wanted to pull the key out.
$ java OutputSecretKey keystore.jceks alias thisisthekeystorepass thekeyhasthispassword
supersecretpassword
```
Note that this code has been adapted from [_How to display Java keystore SecretKeyEntry from command line_](https://stackoverflow.com/a/37491400/2257038) and [_Convert Hex to ASCII in Java_](https://www.baeldung.com/java-convert-hex-to-ascii).