Examples of PasswordAdapter


Examples of com.sun.enterprise.security.store.PasswordAdapter

        throws RepositoryException
    {
        final PEFileLayout layout = getFileLayout(config);
        final File pwdFile = layout.getMasterPasswordFile();                    
        try {                   
            PasswordAdapter p = new PasswordAdapter(pwdFile.getAbsolutePath(),
                getMasterPasswordPassword(config));
            p.setPasswordForAlias(MASTER_PASSWORD_ALIAS, masterPassword.getBytes());
            chmod("600", pwdFile);
        } catch (Exception ex) {                       
            throw new RepositoryException(_strMgr.getString("masterPasswordFileNotCreated", pwdFile),
                ex);
        }
View Full Code Here

Examples of com.sun.enterprise.security.store.PasswordAdapter

    {              
        final PEFileLayout layout = getFileLayout(config);
        final File pwdFile = layout.getMasterPasswordFile();       
        if (pwdFile.exists()) {           
            try {                   
                PasswordAdapter p = new PasswordAdapter(pwdFile.getAbsolutePath(),
                    getMasterPasswordPassword(config));
                return p.getPasswordForAlias(MASTER_PASSWORD_ALIAS);
            } catch (Exception ex) {           
                throw new RepositoryException(_strMgr.getString("masterPasswordFileNotRead", pwdFile),
                    ex);
            }
        } else {
View Full Code Here

Examples of com.sun.enterprise.security.store.PasswordAdapter

        final File passwordAliases = layout.getPasswordAliasKeystore();
        try {
            // WBN July 2007
            // we are constructing this object ONLY to see if it throws
            // an Exception.  We do not use the object.
            new PasswordAdapter(passwordAliases.getAbsolutePath(),
                password.toCharArray());
        } catch (IOException ex) {
            throw new RepositoryException(_strMgr.getString("masterPasswordInvalid"));
        } catch (Exception ex) {       
            throw new RepositoryException(
View Full Code Here

Examples of com.sun.enterprise.security.store.PasswordAdapter

        String password,String alias) throws RepositoryException
    {
        final PEFileLayout layout = getFileLayout(config);
        final File passwordAliases = layout.getPasswordAliasKeystore();
        try {
            PasswordAdapter p = new PasswordAdapter(passwordAliases.getAbsolutePath(),
                password.toCharArray());
            String clearPwd = p.getPasswordForAlias(alias);
            return clearPwd;
        } catch (Exception ex) {
            return null;
        }
    }
View Full Code Here

Examples of com.sun.enterprise.security.store.PasswordAdapter

        String password) throws RepositoryException
    {       
        final PEFileLayout layout = getFileLayout(config);
        final File passwordAliases = layout.getPasswordAliasKeystore();
        try {
            PasswordAdapter p = new PasswordAdapter(passwordAliases.getAbsolutePath(),
                password.toCharArray());
            p.writeStore();
        } catch (Exception ex) {
            throw new RepositoryException(
                _strMgr.getString("passwordAliasKeystoreNotCreated", passwordAliases), ex);
        }
    }
View Full Code Here

Examples of com.sun.enterprise.security.store.PasswordAdapter

        final File passwordAliases = layout.getPasswordAliasKeystore();
           
        //Change the password of the keystore alias file
        if (passwordAliases.exists()) {
            try {
                PasswordAdapter p = new PasswordAdapter(passwordAliases.getAbsolutePath(),
                    oldPassword.toCharArray());
                p.changePassword(newPassword.toCharArray());
            } catch (Exception ex) {
                throw new RepositoryException(
                    _strMgr.getString("passwordAliasPasswordNotChanged", passwordAliases), ex);
            }
        }           
View Full Code Here

Examples of com.sun.enterprise.security.store.PasswordAdapter

        throws CertificateException, IOException, KeyStoreException, NoSuchAlgorithmException
    {
        //The masterPassword in the IdentityManager is available only through
        //a running DAS, server instance, or node agent.
        String masterPassword = IdentityManager.getMasterPassword();
        return new PasswordAdapter(masterPassword.toCharArray());
    }
View Full Code Here

Examples of com.sun.enterprise.security.store.PasswordAdapter

     * @throws ConfigException
     */   
    public void addPasswordAlias(String aliasName, String password) throws ConfigException       
    {
        try {           
            PasswordAdapter p = getPasswordAdapter();
            if (p.aliasExists(aliasName)) {
                throw new ConfigException(_strMgr.getString("passwordAliasExists", aliasName));
            }
            p.setPasswordForAlias(aliasName, password.getBytes());          
        } catch (Exception ex) {
            throw getExceptionHandler().handleConfigException(
                ex, "addPasswordAliasException", aliasName);
        }
    }
View Full Code Here

Examples of com.sun.enterprise.security.store.PasswordAdapter

     * @throws ConfigException
     */   
    public void removePasswordAlias(String aliasName) throws ConfigException       
    {
        try {           
            PasswordAdapter p = getPasswordAdapter();
            if (!p.aliasExists(aliasName)) {
                throw new ConfigException(_strMgr.getString("passwordAliasDoesNotExist", aliasName));
            }
            p.removeAlias(aliasName);
        } catch (Exception ex) {
            throw getExceptionHandler().handleConfigException(
                ex, "removePasswordAliasException", aliasName);
        }
    }
View Full Code Here

Examples of com.sun.enterprise.security.store.PasswordAdapter

     * @throws ConfigException
     */   
    public void updatePasswordAlias(String aliasName, String password) throws ConfigException       
    {
        try {
            PasswordAdapter p = getPasswordAdapter();
            if (!p.aliasExists(aliasName)) {
                throw new ConfigException(_strMgr.getString("passwordAliasDoesNotExist", aliasName));
            }
            p.setPasswordForAlias(aliasName, password.getBytes());
        } catch (Exception ex) {
            throw getExceptionHandler().handleConfigException(
                ex, "updatePasswordAliasException", aliasName);
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.