Android 2.3 Gingerbread

java.security
Class KeyStore.PasswordProtection

java.lang.Object
  extended by java.security.KeyStore.PasswordProtection
All Implemented Interfaces:
KeyStore.ProtectionParameter, Destroyable
Enclosing class:
KeyStore

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

PasswordProtection is a ProtectionParameter that protects a KeyStore using a password.


Constructor Summary
KeyStore.PasswordProtection(char[] password)
          Constructs a new instance of PasswordProtection with a password.
 
Method Summary
 void destroy()
          Destroys / invalidates the password.
 char[] getPassword()
          Returns the password.
 boolean isDestroyed()
          Indicates whether the password is invalidated.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

KeyStore.PasswordProtection

public KeyStore.PasswordProtection(char[] password)
Constructs a new instance of PasswordProtection with a password. A copy of the password is stored in the new PasswordProtection object.

Parameters:
password - the password, maybe null.
Method Detail

getPassword

public char[] getPassword()
Returns the password.

Returns:
the password.
Throws:
IllegalStateException - if the password has been destroyed.

destroy

public void destroy()
             throws DestroyFailedException
Destroys / invalidates the password.

Specified by:
destroy in interface Destroyable
Throws:
DestroyFailedException - if the password could not be invalidated.

isDestroyed

public boolean isDestroyed()
Indicates whether the password is invalidated.

Specified by:
isDestroyed in interface Destroyable
Returns:
true if the password is invalidated, false otherwise.

Android 2.3 Gingerbread