Most visited

Recently visited

Added in API level 1

KeyStore.PasswordProtection

public static class KeyStore.PasswordProtection
extends Object implements KeyStore.ProtectionParameter, Destroyable

java.lang.Object
   ↳ java.security.KeyStore.PasswordProtection


基于密码的实现 ProtectionParameter

Summary

Public constructors

KeyStore.PasswordProtection(char[] password)

创建一个密码参数。

Public methods

void destroy()

清除密码。

char[] getPassword()

获取密码。

boolean isDestroyed()

确定密码是否已被清除。

Inherited methods

From class java.lang.Object
From interface javax.security.auth.Destroyable

Public constructors

KeyStore.PasswordProtection

Added in API level 1
KeyStore.PasswordProtection (char[] password)

创建一个密码参数。

指定的 password在存储到新的 PasswordProtection对象中之前被克隆。

Parameters
password char: the password, which may be null

Public methods

destroy

Added in API level 1
void destroy ()

清除密码。

Throws
if this method was unable to clear the password
DestroyFailedException

getPassword

Added in API level 1
char[] getPassword ()

获取密码。

请注意,此方法返回对密码的引用。 如果创建了一个数组的克隆,则调用者有责任在密码信息不再需要后将其清零。

Returns
char[] the password, which may be null
Throws
IllegalStateException if the password has been cleared (destroyed)

也可以看看:

isDestroyed

Added in API level 1
boolean isDestroyed ()

确定密码是否已被清除。

Returns
boolean true if the password has been cleared, false otherwise

Hooray!