{@inheritDoc}
<p>
安全考虑，password 属性为 null。</p>
341176
public User get(int id) {
        Connection conn = null;
        User user = null;
        try {
            conn = ConnectionUtils.getConnection();
            user = userDAO.get(conn,id);
        } catch(SQLException e) {
            logger.error(e.getMessage());
        } finally {
            DbUtils.closeQuietly(conn);
        }
        return user;
    }
95194
public Ftp init(String host, int port, String user, String password, FtpMode mode) {
		final FTPClient client = new FTPClient();
		client.setControlEncoding(this.charset.toString());
		try {
			// 连接ftp服务器
			client.connect(host, port);
			// 登录ftp服务器
			client.login(user, password);
		} catch (IOException e) {
			throw new FtpException(e);
		}
		final int replyCode = client.getReplyCode(); // 是否成功登录服务器
		if (false == FTPReply.isPositiveCompletion(replyCode)) {
			try {
				client.disconnect();
			} catch (IOException e) {
				// ignore
			}
			throw new FtpException("Login failed for user [{}], reply code is: [{}]", user, replyCode);
		}
		this.client = client;
		if (mode != null ) {
			setMode(mode);
		}
		return this;
	}
995128
private Authentication getAuthentication(SecurityContext securityContext) {
		// 用户未登录
		Authentication authentication = securityContext.getAuthentication();
		if (authentication == null) {
			authentication = new AnonymousAuthenticationToken(UUID.randomUUID().toString(), "anonymous",
					Collections.<GrantedAuthority> singletonList(new SimpleGrantedAuthority("ROLE_ANONYMOUS")));
		}
		return authentication;
	}
902672
private function _hashPassword($password = null)
    {
        if (null !== $password) {
            $this->password = md5($password);
        }

        return $this->password;
    }
458592
public function bind($name = null, $password = null)
    {
        if (strlen(trim($name)) > 0) {
            $password = (null === $password)?'':$password;
            $this->connection->bind($name, $password);
            $this->isBound = true;
            return;
        }

        if ($this->configuration['bind_anonymous']) {
            $this->connection->bind();
            $this->isBound = true;
            return;
        }

        $this->connection->bind(
            $this->configuration['bind_dn'],
            $this->configuration['bind_password']
        );
        $this->isBound = true;
    }
568300
public login login(String username, String password) throws Exception
	{
		this.set_credential(username, password);
		return this.login();
	}
841652
@Override
	public boolean permit(String resourceId, Class c, Object target, String method) {
		if (c.isArray()) {
			// 允许调用，但实际上会在在其后调用中报错。不归此处管理
			return true;
		}
		String name = c.getName();
		String className = null;
		String pkgName = null;
		int i = name.lastIndexOf('.');
		if (i != -1) {
			pkgName = name.substring(0, i);
			className = name.substring(i + 1);

		} else {
			// 无包名，允许调用
			return true;
		}

		if (pkgName.startsWith("java.lang")) {
			if (className.equals("Runtime") || className.equals("Process") || className.equals("ProcessBuilder")
					|| className.equals("System")) {
				return false;
			}
		}

		return true;
	}
98800
@CommandArgument
  public void passwd(
      @OptionArgument("username") String username,
      @OptionArgument("password") String password) {

    User user = users.get(username);

    if (user != null) {
      user.salt = passwd.generateSalt();
      user.hash = passwd.getEncryptedPassword(password, user.salt);
    } else {
      System.err.println(String.format("User '%s' does not exist", username));
    }

  }
649504
@Override
	public final Key keyFromPassword(char[] password) {
		try {
			SecretKeyFactory factory = SecretKeyFactory.getInstance("PBKDF2WithHmacSHA256");
			int keyLength = Math.min(Cipher.getMaxAllowedKeyLength(algorithm), maximumKeyLength);
			KeySpec spec = new PBEKeySpec(password, salt, iterationCount, keyLength);
			SecretKey tmp = factory.generateSecret(spec);
			return new SecretKeySpec(tmp.getEncoded(), algorithm);
		} catch (NoSuchAlgorithmException e) {
			throw new RuntimeException(e);
		} catch (InvalidKeySpecException e) {
			throw new RuntimeException(e);
		}
	}
984250
@Override
    public void setPassword(String password) throws JMSException {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(this, tc, "setPassword", (password == null ? "null" : "non-null"));
        jcaManagedConnectionFactory.setPassword(password);
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(this, tc, "setPassword");
    }
786202
void checkSecurity(String password) {

        I_CmsPasswordHandler handler = OpenCms.getPasswordHandler();
        try {
            handler.validatePassword(password);
            if (handler instanceof I_CmsPasswordSecurityEvaluator) {
                SecurityLevel level = ((I_CmsPasswordSecurityEvaluator)handler).evaluatePasswordSecurity(password);
                m_pw.setErrorPassword1(null, OpenCmsTheme.SECURITY + "-" + level.name());
            } else {
                m_pw.setErrorPassword1(null, OpenCmsTheme.SECURITY_STRONG);
            }
        } catch (CmsSecurityException e) {
            m_pw.setErrorPassword1(
                new UserError(e.getLocalizedMessage(A_CmsUI.get().getLocale())),
                OpenCmsTheme.SECURITY_INVALID);
        }
        if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(m_pw.getPassword2())) {
            showPasswordMatchError(!password.equals(m_pw.getPassword2()));
        }
    }
492149
@Override
    public ExecutionContext authenticate(final Credentials credentials,
            final String repositoryName, final String workspaceName,
            final ExecutionContext repositoryContext,
            final Map<String, Object> sessionAttributes) {
        if (credentials instanceof ServletCredentials) {
            return repositoryContext
                    .with(new AnonymousAdminSecurityContext("bypassAdmin"));
        }
        return null;

    }
516224
public function authenticate(string $credential, string $password = null): ?UserInterface
    {
        $user = $this->users->read($credential);

        if ($user) {
            if ($password && !$this->verifyPassword($user, $password)) {
                return null;
            }

            return ($this->userFactory)(
                $this->users->getIdentifier(),
                $this->getRoles($credential),
                $this->getDetails($user)
            );
        }

        return null;
    }
681375
public function setPassword($password)
    {
        if ($this->username === null) {
            throw new InvalidConfigException('用户名不能为空');
        }
        
        $this->password = md5($password . $this->username);
    }
1301684
@Override
    public Principal authenticate(String username, String credentials) {
        GenericPrincipal principal = (GenericPrincipal) getPrincipal(username);
        if (null != principal) {
            try {
                if (!PasswordStorage.verifyPassword(credentials, principal.getPassword())) {
                    principal = null;
                }
            } catch (CannotPerformOperationException | InvalidHashException e) {
                LOGR.log(Level.WARNING, e.getMessage());
                principal = null;
            }
        }
        return principal;
    }
1316698
public function withBasicAuth(?string $username = null, string $password = null): self
    {
        if ($username === null) {
            return $this->withoutHeader('Authorization');
        } else {
            $auth = base64_encode($username . ':' . $password);

            return $this->withHeader('Authorization', "Basic {$auth}");
        }
    }
666216
public static String encodePassword(final char[] password) {
        if (password == null) {
            return null;
        }
        final EncodedStringConverter converter = new EncodedStringConverter();
        return converter.toString(new String(password));
    }