Validates the password.
This method serves as the inline validation for password.
772789
public function rulePassword($attribute, $message)
    {
        if ($this->password != $this->$attribute) {
            $this->addError($attribute, $message);
        }
    }
1156127
public static boolean validatePassword(String password, String goodHash) throws NoSuchAlgorithmException, InvalidKeySpecException {

    return validatePassword(password.toCharArray(), goodHash);
  }
1341508
public function validateCurrentPassword($password, ExecutionContext $context)
    {
        if (! password_verify($password, $this->getUser()->getPassword())) {
            $context->addViolation('INVALID');
        }
    }
1255329
def validate_password_strength(value):
    
    min_length = 7

    if len(value) < min_length:
        raise ValidationError(_('Password must be at least {0} characters '
                                'long.').format(min_length))

    # check for digit
    if not any(char.isdigit() for char in value):
        raise ValidationError(_('Password must contain at least 1 digit.'))

    # check for letter
    if not any(char.isalpha() for char in value):
        raise ValidationError(_('Password must contain at least 1 letter.'))
613096
private void verifyPasswordStrength() {
        if (isEnabled() && !constraints.isEmpty() && !TextUtils.isEmpty(getText())) {
            float score = getPasswordStrength();
            adaptHelperText(score);
        } else {
            setHelperText(regularHelperText);
        }
    }
1231708
@Override
	public void validate()
	{

		boolean flagA = !controller.isEnableSQLDatabaseOutput();
		boolean flagB = controller.isMultipleOutputFiles();

		OutputCompressionEnum oce = controller.getOutputCompression();

		enableZipEncodingCompression.setSelected(controller
				.isZipCompressionEnabled());

		disableOutputCompression.setSelected(oce == OutputCompressionEnum.None);

		enableBZip2OutputCompression
				.setSelected(oce == OutputCompressionEnum.BZip2);

		activateDataFileOutput.setSelected(controller.isEnableDataFileOutput());

		outputLabel.setEnabled(flagA);
		outputPathField.setEnabled(flagA);

		enableZipEncodingCompression.setEnabled(flagA);

		outputCompression.setEnabled(flagA);
		disableOutputCompression.setEnabled(flagA);

		enable7ZipOutputCompression.setEnabled(flagA
				&& controller.is7ZipEnabled());

		enable7ZipOutputCompression
			.setSelected(oce == OutputCompressionEnum.SevenZip);

		enableBZip2OutputCompression.setEnabled(flagA);

		//Enable multiple output files only for uncompressed output
		enableMultipleOutputFiles.setEnabled(flagA&&(oce == OutputCompressionEnum.None));
		enableMultipleOutputFiles.setSelected(flagB);

		outputSizeLimitLabel.setEnabled(flagA && flagB&&(oce == OutputCompressionEnum.None));
		outputSizeLimitField.setEnabled(flagA && flagB&&(oce == OutputCompressionEnum.None));


	}
1257875
protected boolean validate(boolean validateEmptyFields) {
        boolean isValid = false;
        String value = dataType == PASSWORD ? getText() : getText().trim();
        if (!validateEmptyFields && value.isEmpty()) {
            return true;
        }

        switch (dataType) {
            case TEXT_NAME:
            case NUMBER:
            case PASSWORD:
            case NON_EMPTY_USERNAME:
                isValid = !value.isEmpty();
                break;
            case EMAIL:
                isValid = value.matches(EMAIL_REGEX);
                break;
            case USERNAME:
                isValid = value.matches(USERNAME_REGEX) && value.length() >= 1 && value.length() <= 15;
                break;
            case USERNAME_OR_EMAIL:
                final boolean validEmail = value.matches(EMAIL_REGEX);
                final boolean validUsername = value.matches(USERNAME_REGEX) && value.length() >= 1 && value.length() <= 15;
                isValid = validEmail || validUsername;
                break;
            case MOBILE_PHONE:
            case PHONE_NUMBER:
                isValid = value.matches(PHONE_NUMBER_REGEX);
                break;
            case MFA_CODE:
                isValid = value.matches(CODE_REGEX);
                break;
        }

        Log.v(TAG, "Field validation results: Is valid? " + isValid);
        return isValid;
    }
874250
@SuppressWarnings("unchecked")
    protected void validate() {

        if (m_ou == null) {
            m_name.removeAllValidators();
            m_name.addValidator(new NameValidator());
        }
        m_description.setRequired(true);
        m_description.setRequiredError("Required");

        if (m_ouResources.getRows().isEmpty() & !m_webuser.getValue().booleanValue()) {
            CmsPathSelectField field = new CmsPathSelectField();
            field.setUseRootPaths(true);
            field.setCmsObject(m_cms);
            m_ouResources.addRow(field);
        }
        for (I_CmsEditableGroupRow row : m_ouResources.getRows()) {
            ((AbstractField<String>)row.getComponent()).removeAllValidators();
            ((AbstractField<String>)row.getComponent()).addValidator(new ResourceValidator());
        }
    }
1317781
protected function validatePasswordUser()
    {
        $field = 'password';

        if ($this->isExcluded($field)) {
            return null;
        }

        $value = $this->getSubmitted($field);

        if ($this->isUpdating() && (!isset($value) || $value === '')) {
            return null;
        }

        if (empty($value)) {
            $this->setErrorRequired($field, $this->translation->text('Password'));
            return false;
        }

        return true;
    }
1332571
private function validateDifferentPreviousOne(): bool
    {
        if ($this->options['require-different-than-previous-one'] === true) {
            if (isset($this->options['stored-passwords'][0])) {
                $passwordHash = (string)$this->value;
                if (PasswordEnctyption::compare($passwordHash, $this->options['stored-passwords'][0])) {
                    $this->setError(self::VALIDATOR_ERROR_PASSWORD_MUST_BE_DIFFERENT_THAN_PREVIOUS_ONE);
                    return false;
                }
            }
        }
        return true;
    }
1261245
public void setPassword(CharSequence password) {

        LettuceAssert.notNull(password, "Password must not be null");
        this.password = password.toString().toCharArray();
    }
322462
public function validate()
	{
		$instance = $this->getValidatorInstance();

		if ( !$this->passesAuthorization() )
		{
			$this->failedAuthorization();
		}
		elseif ( !$instance->passes() )
		{
			$this->failedValidation( $instance );
		}
	}
740026
protected function validateOauthCredential()
    {
        if (!$this->isPosted('save')) {
            return false;
        }

        $this->setSubmitted('credential');
        $this->validateElement(array('name' => $this->text('Name')), 'length', array(1, 255));
        $this->validateElement(array('data.id' => $this->text('Client ID')), 'length', array(1, 255));
        $this->validateElement(array('data.secret' => $this->text('Client secret')), 'length', array(1, 255));

        return !$this->hasErrors();
    }
348968
protected function validateUserPasswordInstall()
    {
        $field = 'user.password';

        if ($this->isExcluded($field)) {
            return null;
        }

        $value = $this->getSubmitted($field);
        $label = $this->translation->text('Password');

        if (empty($value)) {
            $this->setErrorRequired($field, $label);
            return false;
        }

        list($min, $max) = $this->user->getPasswordLength();

        $length = mb_strlen($value);

        if ($length < $min || $length > $max) {
            $this->setErrorLengthRange($field, $label, $min, $max);
            return false;
        }

        return true;
    }
769643
def validate(challenge_password, certname, raw_csr)
      @log.debug "running validate"
      fail unless challenge_password.is_a?(String)
      fail unless certname.is_a?(String)

      case perform_validation(challenge_password, certname, raw_csr)
      when true
        @log.debug "validated successfully"
        @log.info  "Validated '#{certname}' using '#{name}' validator"
        return true
      when false
        @log.debug "validation failed"
        @log.debug "Unable to validate '#{certname}' using '#{name}' validator"
        return false
      else
        @log.error "perform_validation returned a non-boolean result"
        raise "perform_validation returned a non-boolean result"
      end
    end
418783
def validate(self):
        
        # Don't call the validator again, if it was already called for the
        # current input.
        if self.validation_state != ValidationState.UNKNOWN:
            return self.validation_state == ValidationState.VALID

        # Validate first. If not valid, set validation exception.
        if self.validator:
            try:
                self.validator.validate(self.document)
            except ValidationError as e:
                # Set cursor position (don't allow invalid values.)
                cursor_position = e.cursor_position
                self.cursor_position = min(max(0, cursor_position), len(self.text))

                self.validation_state = ValidationState.INVALID
                self.validation_error = e
                return False

        self.validation_state = ValidationState.VALID
        self.validation_error = None
        return True
774575
@Override
  public void validate() {
    try {
      IFD ifd = model.getFirstIFD();
      int n = 0;
      while (ifd != null) {
        validateIfd(ifd, n);
        ifd = ifd.getNextIFD();
        n++;
      }
    } catch (Exception e) {

    }
  }