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
synchronized void destroy()
Destroys / invalidates the password.
synchronized char[] getPassword()
Returns the password.
synchronized 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)

Since: 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 synchronized void destroy ()

Since: API Level 1

Destroys / invalidates the password.

Throws
DestroyFailedException if the password could not be invalidated.

public synchronized char[] getPassword ()

Since: API Level 1

Returns the password.

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

public synchronized boolean isDestroyed ()

Since: API Level 1

Indicates whether the password is invalidated.

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