public
static
class
KeyStore.PasswordProtection
extends Object
implements
KeyStore.ProtectionParameter,
Destroyable
java.lang.Object | |
↳ | java.security.KeyStore.PasswordProtection |
A password-based implementation of ProtectionParameter
.
Public constructors | |
---|---|
KeyStore.PasswordProtection(char[] password)
Creates a password parameter. |
Public methods | |
---|---|
void
|
destroy()
Clears the password. |
char[]
|
getPassword()
Gets the password. |
boolean
|
isDestroyed()
Determines if password has been cleared. |
Inherited methods | |
---|---|
From
class
java.lang.Object
| |
From
interface
javax.security.auth.Destroyable
|
KeyStore.PasswordProtection (char[] password)
Creates a password parameter.
The specified password
is cloned before it is stored
in the new PasswordProtection
object.
Parameters | |
---|---|
password |
char :
the password, which may be null
|
void destroy ()
Clears the password.
Throws | |
---|---|
|
if this method was unable to clear the password |
DestroyFailedException |
char[] getPassword ()
Gets the password.
Note that this method returns a reference to the password. If a clone of the array is created it is the caller's responsibility to zero out the password information after it is no longer needed.
Returns | |
---|---|
char[] |
the password, which may be null |
Throws | |
---|---|
IllegalStateException |
if the password has been cleared (destroyed) |
See also:
boolean isDestroyed ()
Determines if password has been cleared.
Returns | |
---|---|
boolean |
true if the password has been cleared, false otherwise |