Examples of PasswordAdapter


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 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

    }
   
    private synchronized PasswordAdapter pa() {
        if (pa == null) {
            try {
                pa = new PasswordAdapter(pathToAliasStore, storePassword);
            } catch (Exception ex) {
                throw new RuntimeException(ex);
            }
        }
        return pa;
View Full Code Here

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

    protected final String readFromMasterPasswordFile() {
        File mpf = getMasterPasswordFile();
        if (mpf == null)
            return null;   // no master password  saved
        try {
            PasswordAdapter pw = new PasswordAdapter(mpf.getAbsolutePath(),
                    "master-password".toCharArray()); // fixed key
            return pw.getPasswordForAlias("master-password");
        }
        catch (Exception e) {
            logger.finer("master password file reading error: "
                    + e.getMessage());
            return null;
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"));
        }
View Full Code Here

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

    public String getClearPasswordForAlias(RepositoryConfig config,
            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

    protected void createPasswordAliasKeystore(RepositoryConfig config,
            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
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.