This interface is used to read characters from a given input without explicitly displaying those characters. The purpose of this class is to provide a simplar secret reading mechanism to Console while abstracting away the implementation.
This interface can be used by tasks by requesting it through the task context.
Common implementations of this interface may be backed by the aforementioned console class from System.console(), may be implemented by a password text box in an IDE, or a properties file that contains identifier based associations to secrets.
Extra information for the user may be provided using the parameters, which will be displayed when the user is prompted for the input. These informations are optional, but are strongly recommended, as they can provide the user information about why the given input is requested.
The provided informations are usually presented in the following way in a console:
<Title information> <A longer explanation about why the given input information is required by the caller.> <The prompt for input:><$cursor>There is no new line after the prompt string.
If the implementation is not backed by a console, the informations may be displayed in dialog using a similar format, or in any other implementation dependent way.
An identifier for the requested secret can be provided in order to accomodate to other secret reading implementation which are not backed by the direct input of the user, but rather an identifier based database. The identifier may be arbitrary, but should be unique.
null
if not specified.null
if not specified.null
if not specified.null
if none.null
in case the user didn't provide an answer. (E.g. closed the
dialog)