KeyStore.PasswordProtection - JRE Emulation | JRE Emulation
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.
Inherited Methods
[Expand]
From class java.lang.Object
From interface javax.security.auth.Destroyable

Public Constructors

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.

Public Methods

public synchronized void destroy ()

Destroys / invalidates the password.

Throws
DestroyFailedException if the password could not be invalidated.

public synchronized char[] getPassword ()

Returns the password.

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

public synchronized boolean isDestroyed ()

Indicates whether the password is invalidated.

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