后浪云鸿蒙OS教程:鸿蒙OS PasswordAuthentication

PasswordAuthentication

java.lang.Object

|—java.net.PasswordAuthentication

public final class PasswordAuthentication
extends Object

PasswordAuthentication 类是 Authenticator 使用的数据持有者。 它只是用户名和密码的存储库。

构造函数摘要

构造函数描述
PasswordAuthentication(String userName, char[] password)从给定的用户名和密码创建一个新的 PasswordAuthentication 对象。

方法总结

修饰符和类型方法描述
char[]getPassword()返回用户密码。
StringgetUserName()返回用户名。
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

构造函数详细信息

PasswordAuthentication

public PasswordAuthentication(String userName, char[] password)

从给定的用户名和密码创建一个新的 PasswordAuthentication 对象。

请注意,给定的用户密码在存储到新的 PasswordAuthentication 对象之前会被克隆。

参数:

参数名称参数描述
userName用户名
password用户密码

方法详情

getUserName

public String getUserName()

返回用户名。

返回:

用户名

getPassword

public char[] getPassword()

返回用户密码。

请注意,此方法返回对密码的引用。 调用者有责任在不再需要密码信息后将其清零。

返回:

密码

文章来源网络,作者:运维,如若转载,请注明出处:https://shuyeidc.com/wp/160113.html<

(0)
运维的头像运维
上一篇2025-03-17 14:58
下一篇 2025-02-06 19:23

相关推荐

发表回复

您的邮箱地址不会被公开。必填项已用 * 标注