Lines Matching defs:password

64     private static final String LOCK_PASSWORD_FILE = "password.key";
147 Log.d(TAG, "lock password file changed");
193 * Gets the device policy password mode. If the mode is non-specific, returns
228 * Returns the actual password mode, as set by keyguard after updating the password.
266 * Check to see if a password matches the saved password. If no password exists,
268 * @param password The password to check.
269 * @return Whether the password matches the stored one.
271 public boolean checkPassword(String password) {
281 // Compare the hash from the file with the entered password's hash
282 return Arrays.equals(stored, passwordToHash(password));
291 * Check to see if a password matches any of the passwords stored in the
292 * password history.
294 * @param password The password to check.
295 * @return Whether the password matches any in the history.
297 public boolean checkPasswordHistory(String password) {
298 String passwordHashString = new String(passwordToHash(password));
354 * Used by device policy manager to validate the current password
400 * Clear any lock pattern or password.
413 * This is only meaningful if pattern, pin or password are not set.
482 keyStore.password(patternToString(pattern));
515 * Compute the password quality from the given password string.
517 static public int computePasswordQuality(String password) {
520 final int len = password.length();
522 if (Character.isDigit(password.charAt(i))) {
541 /** Update the encryption password if it is enabled **/
542 private void updateEncryptionPassword(String password) {
550 Log.e(TAG, "Could not find the mount service to update the encryption password");
556 mountService.changeEncryptionPassword(password);
558 Log.e(TAG, "Error changing encryption password", e);
563 * Save a lock password. Does not ensure that the password is as good
566 * @param password The password to save
569 public void saveLockPassword(String password, int quality) {
570 this.saveLockPassword(password, quality, false);
574 * Save a lock password. Does not ensure that the password is as good
577 * @param password The password to save
581 public void saveLockPassword(String password, int quality, boolean isFallback) {
583 final byte[] hash = passwordToHash(password);
588 if (password == null) {
596 if (password != null) {
597 // Update the encryption password.
598 updateEncryptionPassword(password);
600 // Update the keystore password
601 keyStore.password(password);
603 int computedQuality = computePasswordQuality(password);
614 for (int i = 0; i < password.length(); i++) {
615 char c = password.charAt(i);
631 password.length(), letters, uppercase, lowercase,
634 // The password is not anything.
647 // Add the password to the password history. We assume all
648 // password
688 * @return stored password quality
780 Log.v(TAG, "Initialized lock password salt");
782 // Throw an exception rather than storing a password we'll never be able to recover
790 * Generate a hash for the given password. To avoid brute force attacks, we use a salted hash.
793 * @param password the gesture pattern.
796 public byte[] passwordToHash(String password) {
797 if (password == null) {
803 byte[] saltedPassword = (password + getSalt()).getBytes();
824 * @return Whether the lock password is enabled, or if it is set as a backup for biometric weak