Package convex.cli.mixins
Class KeyStoreMixin
java.lang.Object
convex.cli.ACommand
convex.cli.mixins.AMixin
convex.cli.mixins.KeyStoreMixin
- All Implemented Interfaces:
Runnable
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addKeyPairToStore
(AKeyPair keyPair, char[] keyPassword) Adds key pair to store.Loads the currently specified key Store, creating it if it does not existGets the current key storechar[]
Get the currently configured password for the keystore.boolean
hasSingleKey
(String pk) int
loadKeyFromStore
(String publicKey, char[] keyPassword) Loads a keypair from configured keystoreLoads the currently specified key Store.void
void
saveKeyStore
(char[] storePassword) static String
Methods inherited from class convex.cli.ACommand
commandLine, inform, inform, informError, informSuccess, informWarning, isColoured, isInteractive, isParanoid, paranoia, println, println, printRecord, printResult, prompt, readPassword, run, showUsage, verbose
-
Constructor Details
-
KeyStoreMixin
public KeyStoreMixin()
-
-
Method Details
-
getStorePath
-
getStorePassword
public char[] getStorePassword()Get the currently configured password for the keystore.- Returns:
- Password, or null if unspecified
-
getKeystore
Gets the current key store- Returns:
- KeyStore instance, or null if it is not loaded
-
ensureKeyStore
Loads the currently specified key Store, creating it if it does not exist- Returns:
- KeyStore instance
-
loadKeyStore
Loads the currently specified key Store. Does not create- Returns:
- KeyStore instance, or null if it does not exist
-
saveKeyStore
public void saveKeyStore() -
saveKeyStore
public void saveKeyStore(char[] storePassword) -
addKeyPairToStore
Adds key pair to store. Does not save keystore!- Parameters:
keyPair
- Keypair to addkeyPassword
- PAssword for new key
-
trimKey
-
loadKeyFromStore
Loads a keypair from configured keystore- Parameters:
publicKey
- String identifying the public key. May be a prefix- Returns:
- Keypair instance, or null if not found
-
hasSingleKey
-
keyCount
-