Class KeystoreManager
java.lang.Object
com.sun.enterprise.admin.servermgmt.KeystoreManager
- Direct Known Subclasses:
MasterPasswordFileManager,NodeKeystoreManager
- Author:
- kebbs
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected PEFileLayoutstatic final Stringstatic final Stringstatic final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidchangeKeystorePassword(String oldPassword, String newPassword, File keystore) Changes the keystore passwordprotected voidchangeS1ASAliasPassword(RepositoryConfig config, String storePassword, String oldKeyPassword, String newKeyPassword) Changes the key password for the default cert whose alias is s1as.protected voidchangeSSLCertificateDatabasePassword(RepositoryConfig config, String oldPassword, String newPassword) Changes the password of the keystore, truststore and the key password of the s1as alias.protected voidprotected voidcopyCertificatesToTrustStore(File configRoot, DomainConfig config, String masterPassword) protected voidcreateKeyStore(File keystore, RepositoryConfig config, String masterPassword) Create the default SSL key store using keytool to generate a self signed certificate.protected static StringgetCertificateDN(RepositoryConfig cfg, String CNSuffix) static Stringprotected PEFileLayoutgetFileLayout(RepositoryConfig config) static String
-
Field Details
-
CERTIFICATE_ALIAS
- See Also:
-
INSTANCE_SECURE_ADMIN_ALIAS
- See Also:
-
DEFAULT_MASTER_PASSWORD
- See Also:
-
_fileLayout
-
-
Constructor Details
-
KeystoreManager
public KeystoreManager()Creates a new instance of RepositoryManager
-
-
Method Details
-
getCertificateDN
-
getFileLayout
-
createKeyStore
protected void createKeyStore(File keystore, RepositoryConfig config, String masterPassword) throws RepositoryException Create the default SSL key store using keytool to generate a self signed certificate.- Parameters:
config-masterPassword-- Throws:
RepositoryException
-
copyCertificatesToTrustStore
protected void copyCertificatesToTrustStore(File configRoot, DomainConfig config, String masterPassword) throws DomainException - Throws:
DomainException
-
changeKeystorePassword
protected void changeKeystorePassword(String oldPassword, String newPassword, File keystore) throws RepositoryException Changes the keystore password- Parameters:
oldPassword- the old keystore passwordnewPassword- the new keystore passwordkeystore- the keystore whose password is to be changed.- Throws:
RepositoryException
-
changeS1ASAliasPassword
protected void changeS1ASAliasPassword(RepositoryConfig config, String storePassword, String oldKeyPassword, String newKeyPassword) throws RepositoryException Changes the key password for the default cert whose alias is s1as. The assumption here is that the keystore password is not the same as the key password. This is due to the fact that the keystore password should first be changed followed next by the key password. The end result is that the keystore and s1as key both have the same passwords. This function will tolerate deletion of the s1as alias, but it will not tolerate changing the s1as key from something other than the database password.- Parameters:
config-storePassword- the keystore passwordoldKeyPassword- the old password for the s1as aliasnewKeyPassword- the new password for the s1as alias- Throws:
RepositoryException
-
changeSSLCertificateDatabasePassword
protected void changeSSLCertificateDatabasePassword(RepositoryConfig config, String oldPassword, String newPassword) throws RepositoryException Changes the password of the keystore, truststore and the key password of the s1as alias. It is expected that the key / truststores may not exist. This is due to the fact that the user may have deleted them and wishes to set up their own key/truststore- Parameters:
config-storePassword-oldKeyPassword-newKeyPassword-- Throws:
RepositoryException
-
chmod
- Throws:
IOException
-
getDASCertDN
-
getInstanceCertDN
-