JavaTM 2 Platform
Standard Ed. 6

java.security
类 KeyStore.PasswordProtection

java.lang.Object
  继承者 java.security.KeyStore.PasswordProtection
所有已实现的接口:
KeyStore.ProtectionParameter, Destroyable
正在封闭类:
KeyStore

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

ProtectionParameter 的一个基于密码的实现。

从以下版本开始:
1.5

构造方法摘要
KeyStore.PasswordProtection(char[] password)
          创建一个 password 参数。
 
方法摘要
 void destroy()
          清除密码。
 char[] getPassword()
          获取密码。
 boolean isDestroyed()
          确定密码是否已被清除。
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

构造方法详细信息

KeyStore.PasswordProtection

public KeyStore.PasswordProtection(char[] password)
创建一个 password 参数。

在将指定的 password 存储进新的 PasswordProtection 对象前将其复制。

方法详细信息

getPassword

public char[] getPassword()
获取密码。

注意,此方法返回一个对密码的引用。如果创建了数组的一个副本,调用方负责在不再需要密码后清空密码信息。

返回:
密码,它可以为 null
抛出:
IllegalStateException - 如果密码已经被清除(销毁)
另请参见:
destroy()

destroy

public void destroy()
             throws DestroyFailedException
清除密码。

指定者:
接口 Destroyable 中的 destroy
抛出:
DestroyFailedException - 如果此方法不能清除密码。

isDestroyed

public boolean isDestroyed()
确定密码是否已被清除。

指定者:
接口 Destroyable 中的 isDestroyed
返回:
如果密码已经被清除,则返回 true;否则,返回 false。

JavaTM 2 Platform
Standard Ed. 6

提交错误或意见

版权所有 2008 Sun Microsystems, Inc. 保留所有权利。请遵守GNU General Public License, version 2 only