Class KeyStoreMixin

All Implemented Interfaces:
Runnable

public class KeyStoreMixin extends AMixin
  • Constructor Details

    • KeyStoreMixin

      public KeyStoreMixin()
  • Method Details

    • getStorePath

      public Path getStorePath()
    • getStorePassword

      public char[] getStorePassword()
      Get the currently configured password for the keystore.
      Returns:
      Password, or null if unspecified
    • getKeystore

      public KeyStore getKeystore()
      Gets the current key store
      Returns:
      KeyStore instance, or null if it is not loaded
    • ensureKeyStore

      public KeyStore ensureKeyStore()
      Loads the currently specified key Store, creating it if it does not exist
      Returns:
      KeyStore instance
    • loadKeyStore

      public KeyStore 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

      public void addKeyPairToStore(AKeyPair keyPair, char[] keyPassword)
      Adds key pair to store. Does not save keystore!
      Parameters:
      keyPair - Keypair to add
      keyPassword - PAssword for new key
    • trimKey

      public static String trimKey(String publicKey)
    • loadKeyFromStore

      public AKeyPair loadKeyFromStore(String publicKey, char[] keyPassword)
      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

      public boolean hasSingleKey(String pk)
    • keyCount

      public int keyCount(String pk)