Package ghidra.net

Class ApplicationKeyManagerFactory

java.lang.Object
ghidra.net.ApplicationKeyManagerFactory

public class ApplicationKeyManagerFactory extends Object
ApplicationKeyManagerFactory provides a factory for using and caching X509 keystores.
  • Method Details

    • setKeyStorePasswordProvider

      public static void setKeyStorePasswordProvider(KeyStorePasswordProvider provider)
      Set the active keystore password provider
      Parameters:
      provider - keystore password provider
    • clearKeyManagerCache

      public static void clearKeyManagerCache()
      Clear all cached key managers. NOTE: This is primarily intended for test use only.
    • getKeyManager

      public static X509KeyManager getKeyManager(String keystorePath, String defaultPasswd) throws CancelledException, KeyStoreException
      Get key manager for specified JKS or PKCS12 keystore file path. The user may be prompted for a password if required which will block the invocation of this synchronized method. If successfully opened, the resulting key manager instance will be cached for subsequent re-use of the same keystore.
      Parameters:
      keystorePath - protected keystore path
      defaultPasswd - default password (e.g., supplied by property) or null
      Returns:
      key manager
      Throws:
      CancelledException - password entry was cancelled by user
      KeyStoreException - error occurred opening/processing keystore