Class AsadminSecurityUtil
java.lang.Object
com.sun.enterprise.security.store.AsadminSecurityUtil
Various utility methods related to certificate-based security.
In particular, this class opens both the client-side keystore and the client-side truststore when either one is requested. This allows us to prompt only once for the master password (if necessary) without storing the password the user responds with which would be a security risk.
- Author:
- Tim Quinn (with portions refactored from elsewhere)
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionReturns the opened AsadminTruststore object.static char[]static FilegetGfClientSessionFile(String host, int port) static AsadminSecurityUtilgetInstance(boolean isPromptable) Returns the usable instance, creating it if needed.static AsadminSecurityUtilgetInstance(char[] commandLineMasterPassword, boolean isPromptable) Returns the usable instance, creating it if needed.
-
Field Details
-
GF_CLIENT_DIR
Existing writable GlassFish client directory. It is used for caching data, locating SSH keys, etc.
-
-
Method Details
-
getGfClientSessionFile
- Parameters:
host-port-- Returns:
- $GF_CLIENT_DIR/cache/{host}_{port}/session
-
getInstance
public static AsadminSecurityUtil getInstance(char[] commandLineMasterPassword, boolean isPromptable) Returns the usable instance, creating it if needed.- Parameters:
commandLineMasterPassword- password provided via the command lineisPromptable- if the command requiring the object was run by a human who is present to respond to a prompt for the master password- Returns:
- the usable instance
-
getInstance
Returns the usable instance, creating it if needed.- Parameters:
isPromptable- if the command requiring the object was run by a human who is present to respond to a prompt for the master password- Returns:
-
getAsadminTruststorePassword
public static char[] getAsadminTruststorePassword()- Returns:
- the master password for the keystore and truststore, as set by the system property (defaulted if the property is not set).
-
getAsadminTruststore
Returns the opened AsadminTruststore object.- Returns:
- the AsadminTruststore object
-
getAsadminKeystore
-