Top Description Fields Constructors Methods
jakarta.security.enterprise.credential

public Class Password

extends Object
Class Inheritance
Static Imports
java.util.Arrays.copyOf

Represents a text-based password, and includes a built-in mechanism for securely clearing the value.

Field Summary

Modifier and TypeField and Description
private static final char[]
private volatile char[]

Constructor Summary

AccessConstructor and Description
public
Password(char[]
The password value
value
)

Constructor

public
Password(String
The password value
value
)

Constructor

Method Summary

Modifier and TypeMethod and Description
public void
clear()

Securely clears the password value.

public boolean
compareTo(String password)

public char[]

Returns:

The password value, empty array if cleared.
getValue
()

Determines the password value.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

EMPTY_VALUEback to summary
private static final char[] EMPTY_VALUE
valueback to summary
private volatile char[] value

Constructor Detail

Passwordback to summary
public Password(char[] value)

Constructor

Parameters
value:char[]

The password value

Exceptions
NullPointerException:
Value is null
Passwordback to summary
public Password(String value)

Constructor

Parameters
value:String

The password value

Exceptions
NullPointerException:
Value is null

Method Detail

clearback to summary
public void clear()

Securely clears the password value.

compareToback to summary
public boolean compareTo(String password)
getValueback to summary
public char[] getValue()

Determines the password value.

Returns:char[]

The password value, empty array if cleared.