Class Password

java.lang.Object
jakarta.security.enterprise.credential.Password

public class Password extends Object
Represents a text-based password, and includes a built-in mechanism for securely clearing the value.
  • Constructor Details Link icon

    • Password Link icon

      public Password(char[] value)
      Constructor
      Parameters:
      value - The password value
      Throws:
      NullPointerException - Value is null
    • Password Link icon

      public Password(String value)
      Constructor
      Parameters:
      value - The password value
      Throws:
      NullPointerException - Value is null
  • Method Details Link icon

    • getValue Link icon

      public char[] getValue()
      Determines the password value.
      Returns:
      The password value, empty array if cleared.
    • clear Link icon

      public void clear()
      Securely clears the password value.
    • compareTo Link icon

      public boolean compareTo(String password)