r/java • • 4d ago

Keystore: CLI-Based key manager for Java

Some weeks ago I started working on a Java CLI-based keystore app. I know some mature ones already exist on the market, but I wanted it to be as simple to use as possible and include commands that suit my work.

GitHub Repository: https://github.com/mateasmario/keystore

Until this moment, some functionality includes:

  • adding, removing, getting and listing custom keys

  • copying a key without displaying it on the screen

  • listing all keys without displaying their value on the screen

  • generating keys based on certain criteria (length, include digits, uppercase, lowercase, symbols, etc.)

  • generating OTP values based on the current time (elapsed seconds after epoch time - 1970) and already stored keys

Managing keys requires a password that is set by the user (keyboard input) when the first key is added/generated to the keystore. That password is used to AES-Encrypt the keystore file in the user data directory (e.g. %localappdata% for Windows).

There is also the possibility of switching to the FILE mode, which is going to ask the user for a file path instead of typing a password. That file contains the key that can be used to decrypt (maybe you keep your secrets on a USB drive). You don't need to create the key manually. Even in FILE mode, the user's still going to be asked for a password the first time, which will be used to derive a key and store it in the specified file path.

Was curious on how I can improve it: how to improve both user experience and also add features that might be helpful to you, the developer community.

3 Upvotes

3 comments sorted by

5

u/maxandersen 3d ago

Cool - how about publishing a jar or maven GAV so one can run and install it using jbang on all platforms ?

3

u/Puzzled-Comb1369 3d ago

a shaded fat jar attached to the release page would also work right away without needing to go through central publishing setup

2

u/r410b 2d ago

It could be worth adding a section on how you implemented the crypto.