Android APIs
public static class

KeyStore.PasswordProtection

extends Object
implements KeyStore.ProtectionParameter Destroyable
java.lang.Object
   ↳ java.security.KeyStore.PasswordProtection

Class Overview

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

Summary

Public Constructors
KeyStore.PasswordProtection(char[] password)
Constructs a new instance of PasswordProtection with a password.
Public Methods
void destroy()
Destroys / invalidates the password.
char[] getPassword()
Returns the password.
boolean isDestroyed()
Indicates whether the password is invalidated.
[Expand]
Inherited Methods
From class java.lang.Object
From interface javax.security.auth.Destroyable

Public Constructors

public KeyStore.PasswordProtection (char[] password)

Added in API level 1

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.

Public Methods

public void destroy ()

Added in API level 1

Destroys / invalidates the password.

Throws
DestroyFailedException if the password could not be invalidated.

public char[] getPassword ()

Added in API level 1

Returns the password.

Returns
  • the password.
Throws
IllegalStateException if the password has been destroyed.

public boolean isDestroyed ()

Added in API level 1

Indicates whether the password is invalidated.

Returns
  • true if the password is invalidated, false otherwise.