public static class KeyStore.PasswordProtection
extends Object implements KeyStore.ProtectionParameter, Destroyable
| java.lang.Object | |
| java.security.KeyStore.PasswordProtection | |
基于密码的实现 ProtectionParameter 。
Public constructors |
|
|---|---|
KeyStore.PasswordProtection(char[] password) 创建一个密码参数。 |
|
公共方法(Public methods) |
|
|---|---|
void |
destroy() 清除密码。 |
char[] |
getPassword() 获取密码。 |
boolean |
isDestroyed() 确定密码是否已被清除。 |
继承方法(Inherited methods) |
|
|---|---|
java.lang.Object
|
|
javax.security.auth.Destroyable
|
|
KeyStore.PasswordProtection (char[] password)
创建一个密码参数。
指定的 password在存储到新的 PasswordProtection对象中之前被克隆。
| 参数(Parameters) | |
|---|---|
password |
char: the password, which may be null |
void destroy ()
清除密码。
| 抛出异常(Throws) | |
|---|---|
|
if this method was unable to clear the password |
DestroyFailedException |
|
char[] getPassword ()
获取密码。
请注意,此方法返回对密码的引用。 如果创建了一个数组的克隆,则调用者有责任在密码信息不再需要后将其清零。
| 返回(Returns) | |
|---|---|
char[] |
the password, which may be null |
| 抛出异常(Throws) | |
|---|---|
IllegalStateException |
if the password has been cleared (destroyed) |
也可以看看:
boolean isDestroyed ()
确定密码是否已被清除。
| 返回(Returns) | |
|---|---|
boolean |
true if the password has been cleared, false otherwise |