Added in API level 1

PasswordCallback

open class PasswordCallback : Callback, Serializable
kotlin.Any
   ↳ javax.security.auth.callback.PasswordCallback

Underlying security services instantiate and pass a PasswordCallback to the handle method of a CallbackHandler to retrieve password information.

Summary

Public constructors
PasswordCallback(prompt: String!, echoOn: Boolean)

Construct a PasswordCallback with a prompt and a boolean specifying whether the password should be displayed as it is being typed.

Public methods
open Unit

Clear the retrieved password.

open CharArray!

Get the retrieved password.

open String!

Get the prompt.

open Boolean

Return whether the password should be displayed as it is being typed.

open Unit
setPassword(password: CharArray!)

Set the retrieved password.

Public constructors

PasswordCallback

Added in API level 1
PasswordCallback(
    prompt: String!,
    echoOn: Boolean)

Construct a PasswordCallback with a prompt and a boolean specifying whether the password should be displayed as it is being typed.

Parameters
prompt String!: the prompt used to request the password.

echoOn Boolean: true if the password should be displayed as it is being typed.
Exceptions
java.lang.IllegalArgumentException if prompt is null or if prompt has a length of 0.

Public methods

clearPassword

Added in API level 1
open fun clearPassword(): Unit

Clear the retrieved password.

getPassword

Added in API level 1
open fun getPassword(): CharArray!

Get the retrieved password.

This method returns a copy of the retrieved password.

Return
CharArray! the retrieved password, which may be null.

See Also

getPrompt

Added in API level 1
open fun getPrompt(): String!

Get the prompt.

Return
String! the prompt.

isEchoOn

Added in API level 1
open fun isEchoOn(): Boolean

Return whether the password should be displayed as it is being typed.

Return
Boolean the whether the password should be displayed as it is being typed.

setPassword

Added in API level 1
open fun setPassword(password: CharArray!): Unit

Set the retrieved password.

This method makes a copy of the input password before storing it.

Parameters
password CharArray!: the retrieved password, which may be null.

See Also