com.sun.enterprise.security.store
Class AsadminSecurityUtil

java.lang.Object
  extended by com.sun.enterprise.security.store.AsadminSecurityUtil

public class AsadminSecurityUtil
extends Object

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)

Method Summary
 KeyStore getAsadminKeystore()
           
 AsadminTruststore getAsadminTruststore()
          Returns the opened AsadminTruststore object.
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).
static AsadminSecurityUtil getInstance(boolean isPromptable)
          Returns the usable instance, creating it if needed.
static AsadminSecurityUtil getInstance(char[] commandLineMasterPassword, boolean isPromptable)
          Returns the usable instance, creating it if needed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static AsadminSecurityUtil getInstance(char[] commandLineMasterPassword,
                                              boolean isPromptable)
Returns the usable instance, creating it if needed.

Parameters:
commandLineMasterPassword - password provided via the command line
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:
the usable instance

getInstance

public static AsadminSecurityUtil getInstance(boolean isPromptable)
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).

Returns:

getAsadminTruststore

public AsadminTruststore getAsadminTruststore()
Returns the opened AsadminTruststore object.

Returns:
the AsadminTruststore object

getAsadminKeystore

public KeyStore getAsadminKeystore()


Copyright © 2012 GlassFish Community. All Rights Reserved.