public final class PasswordAuthentication extends Object
Authenticator
, Authenticator.getPasswordAuthentication()
Constructor and Description |
---|
PasswordAuthentication(String userName, char[] password)
从给定的用户名和密码创建一个新的
PasswordAuthentication 对象。
|
public PasswordAuthentication(String userName, char[] password)
PasswordAuthentication
对象。
请注意,给定的用户密码在存储在新的PasswordAuthentication
对象之前被克隆。
userName
- 用户名
password
- 用户密码
public String getUserName()
public char[] getPassword()
请注意,此方法返回对密码的引用。 呼叫者有责任在不再需要密码信息后将其清除。
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.