Package ghidra.net
Class ApplicationKeyManagerFactory
java.lang.Object
ghidra.net.ApplicationKeyManagerFactory
ApplicationKeyManagerFactory provides a factory for using and caching X509 keystores.-
Method Summary
Modifier and TypeMethodDescriptionstatic voidClear all cached key managers.static X509KeyManagergetKeyManager(String keystorePath, String defaultPasswd) Get key manager for specified JKS or PKCS12 keystore file path.static voidSet the active keystore password provider
-
Method Details
-
setKeyStorePasswordProvider
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 pathdefaultPasswd- default password (e.g., supplied by property) or null- Returns:
- key manager
- Throws:
CancelledException- password entry was cancelled by userKeyStoreException- error occurred opening/processing keystore
-