Package org.jmanage.core.crypto

Examples of org.jmanage.core.crypto.EncryptedKey


            System.out.println("\nError in reading application passwords") ;
            return ;
        }

        /* Write new key to file */
      EncryptedKey encryptedKey = new EncryptedKey(newPassword);
      KeyManager.writeKey(encryptedKey);
      /* Change admin password */
      UserManager.getInstance().deleteUser(AuthConstants.USER_ADMIN);
      List roles = new ArrayList(1); // TODO: Shouldn't this be zero ? -rk
      UserManager.getInstance().addUser(new User(AuthConstants.USER_ADMIN,
View Full Code Here


        /* update the password for admin */
        admin.setPassword(Crypto.hash(newPassword));
        userManager.updateUser(admin);

        /* re-encrypt the key */
        EncryptedKey encryptedKey = KeyManager.readKey(oldPassword);
        encryptedKey.setPassword(newPassword);
        /* write the encryptedKey to the key file */
        KeyManager.writeKey(encryptedKey);

        System.out.println("Password has been changed");
    }
View Full Code Here

        }

        /* TODO: there is some odd behavior with this code - rk*/
        if(context.getUser().getName().equals(AuthConstants.USER_ADMIN)){
            /* re-encrypt the key */
            EncryptedKey encryptedKey = KeyManager.readKey(changePasswordForm.getOldPassword().toCharArray());
            encryptedKey.setPassword(changePasswordForm.getNewPassword().toCharArray());
            /* write the encryptedKey to the key file */
            KeyManager.writeKey(encryptedKey);
        }

        String username = context.getUser().getUsername();
View Full Code Here

TOP

Related Classes of org.jmanage.core.crypto.EncryptedKey

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.