mirror of
https://github.com/NationalSecurityAgency/ghidra
synced 2024-10-02 16:33:49 +00:00
GP-0: Fix javadocs for GhidraScript.askPassword()
This commit is contained in:
parent
a7063c672e
commit
493afe7602
|
@ -2994,22 +2994,17 @@ public abstract class GhidraScript extends FlatProgramAPI {
|
|||
* <pre>
|
||||
* String user = askString("Login", "Username:");
|
||||
* Project project;
|
||||
* try (Secret secret = askSecret("Login", "Password:")) {
|
||||
* if (secret == null) {
|
||||
* return; // User cancelled
|
||||
* }
|
||||
* project = doLoginAndOpenProject(user, secret.buffer());
|
||||
* try (Password password = askPassword("Login", "Password:")) {
|
||||
* project = doLoginAndOpenProject(user, password.getPasswordChars());
|
||||
* }
|
||||
* </pre>
|
||||
*
|
||||
* The buffer will be zero-filled upon leaving the {@code try-with-resources} block. If, in the
|
||||
* sample, the {@code doLoginAndOpenProject} method or any part of its implementation needs to
|
||||
* retain the secret, it must make a copy. It is then the implementation's responsibility to
|
||||
* retain the password, it must make a copy. It is then the implementation's responsibility to
|
||||
* protect its copy.
|
||||
*
|
||||
* @param title the title of the dialog
|
||||
* @param serverType the server type, i.e., its protocol or URL schema
|
||||
* @param serverName the host name of the server
|
||||
* @param prompt the prompt to the left of the input field, or null to display "Password:"
|
||||
* @return the password
|
||||
* @throws CancelledException if the user cancels
|
||||
|
|
Loading…
Reference in a new issue