Module jakarta.security
Class AbstractClearableCredential
java.lang.Object
jakarta.security.enterprise.credential.AbstractClearableCredential
- All Implemented Interfaces:
Credential
- Direct Known Subclasses:
UsernamePasswordCredential
AbstractClearableCredential
contains behavior common to
Credential
implementations that can be meaningfully
cleared.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfinal void
clear()
Clears the credential.protected abstract void
Invokes the specific subclass to securely clear the credential value.final boolean
Determines whether the credential value has been securely cleared.protected final void
Specifies that the credential value has been securely cleared.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface jakarta.security.enterprise.credential.Credential
isValid
-
Constructor Details
-
AbstractClearableCredential
public AbstractClearableCredential()
-
-
Method Details
-
isCleared
public final boolean isCleared()Description copied from interface:Credential
Determines whether the credential value has been securely cleared.- Specified by:
isCleared
in interfaceCredential
- Returns:
true
if the credential has been cleared, otherwise false.
-
setCleared
protected final void setCleared()Specifies that the credential value has been securely cleared. -
clear
public final void clear()Description copied from interface:Credential
Clears the credential. For example, if the credential includes a password, this method would overwrite the password value.- Specified by:
clear
in interfaceCredential
-
clearCredential
protected abstract void clearCredential()Invokes the specific subclass to securely clear the credential value. Some
subclasses contain credential values which are inherently secure, such as tokens, for which clearing the credential may not be necessary.Credential
For example, if the credential includes a password, this method would overwrite the password value.
-