Package com.sun.enterprise.security.store

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


    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

        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

        throws RepositoryException
    {
        final PEFileLayout layout = getFileLayout(config);
        final File pwdFile = layout.getMasterPasswordFile();                    
        try {                   
            PasswordAdapter p = new PasswordAdapter(pwdFile.getAbsolutePath(),
                getMasterPasswordPassword());
            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

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

        boolean saveMasterPassword) throws RepositoryException
    {
          FileUtils.deleteFile(pwdFile);
        if (saveMasterPassword) {
           try {                   
                 PasswordAdapter p = new PasswordAdapter(pwdFile.getAbsolutePath(),
                     getMasterPasswordPassword());
                 p.setPasswordForAlias(MASTER_PASSWORD_ALIAS, newPassword.getBytes());
                 chmod("600", pwdFile);
             } catch (Exception ex) {                       
                 throw new RepositoryException(_strMgr.getString("masterPasswordFileNotCreated", pwdFile),
                     ex);
             }
View Full Code Here

            File mp = env.getMasterPasswordFile();
            if (!mp.isFile()) {
                logger.fine("The JCEKS file: " + mp.getAbsolutePath() + " does not exist, master password was not saved on disk during domain creation");
                return false;
            }
            PasswordAdapter p   = new PasswordAdapter(mp.getAbsolutePath(), FIXED_KEY.toCharArray());
            String mpstr = p.getPasswordForAlias(FIXED_KEY);
            if (mpstr == null) {
                return false;
            }
            masterPassword = mpstr.toCharArray();
            return true;
View Full Code Here

    public void setMasterPassword(char[] masterPassword) {
        _masterPassword = Arrays.copyOf(masterPassword, masterPassword.length);
    }

    public PasswordAdapter getMasterPasswordAdapter() throws CertificateException, IOException, KeyStoreException, NoSuchAlgorithmException {
        PasswordAdapter passwordAdapter = new PasswordAdapter(_masterPassword);
        return passwordAdapter;
    }
View Full Code Here

   
    @Override
    public PasswordAdapter getMasterPasswordAdapter()
            throws CertificateException, IOException, KeyStoreException, NoSuchAlgorithmException {
        char pw[] = idm == null ? null : idm.getMasterPassword();
        return new PasswordAdapter(pw);
    }
View Full Code Here

    public void setMasterPassword(char[] masterPassword) {
        _masterPassword = Arrays.copyOf(masterPassword, masterPassword.length);
    }

    public PasswordAdapter getMasterPasswordAdapter() throws CertificateException, IOException, KeyStoreException, NoSuchAlgorithmException {
        PasswordAdapter passwordAdapter = new PasswordAdapter(_masterPassword);
        return passwordAdapter;
    }
View Full Code Here

TOP

Related Classes of com.sun.enterprise.security.store.PasswordAdapter

Copyright © 2018 www.massapicom. 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.