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

public Class UsernamePasswordCredential

extends AbstractClearableCredential
Class Inheritance
Known Direct Subclasses
jakarta.security.enterprise.credential.BasicAuthenticationCredential

Represents the credentials typically used by standard caller name/password authentication.

Field Summary

Modifier and TypeField and Description
private final String
private final Password

Constructor Summary

AccessConstructor and Description
public
UsernamePasswordCredential(String
The caller name
callerName
,
String
The password, as a String
password
)

Constructor.

public
UsernamePasswordCredential(String
The caller name
callerName
,
Password
The password
password
)

Constructor.

Method Summary

Modifier and TypeMethod and Description
public void
clearCredential()

Implements abstract jakarta.security.enterprise.credential.AbstractClearableCredential.clearCredential.

Invokes the specific subclass to securely clear the credential value.

public boolean
compareTo(String callerName, String password)

public String
public Password

Returns:

The password.
getPassword
()

Determines the password.

public String

Returns:

The password, as a String.
getPasswordAsString
()

Determines the password.

Inherited from jakarta.security.enterprise.credential.AbstractClearableCredential:
clearisClearedsetCleared

Field Detail

callerback to summary
private final String caller
passwordback to summary
private final Password password

Constructor Detail

UsernamePasswordCredentialback to summary
public UsernamePasswordCredential(String callerName, String password)

Constructor.

Parameters
callerName:String

The caller name

password:String

The password, as a String

UsernamePasswordCredentialback to summary
public UsernamePasswordCredential(String callerName, Password password)

Constructor.

Parameters
callerName:String

The caller name

password:Password

The password

Method Detail

clearCredentialback to summary
public void clearCredential()

Implements abstract jakarta.security.enterprise.credential.AbstractClearableCredential.clearCredential.

Doc from jakarta.security.enterprise.credential.AbstractClearableCredential.clearCredential.

Invokes the specific subclass to securely clear the credential value. Some Credential subclasses contain credential values which are inherently secure, such as tokens, for which clearing the credential may not be necessary.

For example, if the credential includes a password, this method would overwrite the password value.

Annotations
@Override
compareToback to summary
public boolean compareTo(String callerName, String password)
getCallerback to summary
public String getCaller()
getPasswordback to summary
public Password getPassword()

Determines the password.

Returns:Password

The password.

getPasswordAsStringback to summary
public String getPasswordAsString()

Determines the password.

Returns:String

The password, as a String.