java.lang.Object
jakarta.security.enterprise.credential.Password
public class Password
extends java.lang.Object
Represents a text-based password, and includes a built-in mechanism for securely
clearing the value.
-
Constructor Summary
Constructors
Constructor |
Description |
Password(char[] value) |
Constructor
|
Password(java.lang.String value) |
Constructor
|
-
Method Summary
Modifier and Type |
Method |
Description |
void |
clear() |
Securely clears the password value.
|
boolean |
compareTo(java.lang.String password) |
|
char[] |
getValue() |
Determines the password value.
|
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
public Password(char[] value)
Constructor
- Parameters:
value
- The password value
- Throws:
java.lang.NullPointerException
- Value is null
-
public Password(java.lang.String value)
Constructor
- Parameters:
value
- The password value
- Throws:
java.lang.NullPointerException
- Value is null
-
Method Details
-
public char[] getValue()
Determines the password value.
- Returns:
- The password value, empty array if cleared.
-
public void clear()
Securely clears the password value.
-
public boolean compareTo(java.lang.String password)