Package java.security
Class KeyStore.PasswordProtection
- java.lang.Object
-
- java.security.KeyStore.PasswordProtection
-
- All Implemented Interfaces:
KeyStore.ProtectionParameter,Destroyable
- Enclosing class:
- KeyStore
public static class KeyStore.PasswordProtection extends Object implements KeyStore.ProtectionParameter, Destroyable
PasswordProtectionis aProtectionParameterthat protects aKeyStoreusing a password.
-
-
Constructor Summary
Constructors Constructor Description PasswordProtection(char[] password)Constructs a new instance ofPasswordProtectionwith a password.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddestroy()Destroys / invalidates the password.char[]getPassword()Returns the password.booleanisDestroyed()Indicates whether the password is invalidated.
-
-
-
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 DestroyFailedExceptionDestroys / invalidates the password.- Specified by:
destroyin interfaceDestroyable- Throws:
DestroyFailedException- if the password could not be invalidated.
-
isDestroyed
public boolean isDestroyed()
Indicates whether the password is invalidated.- Specified by:
isDestroyedin interfaceDestroyable- Returns:
trueif the password is invalidated,falseotherwise.
-
-