Mercurial > 510Connectbot
annotate app/src/main/java/ch/ethz/ssh2/InteractiveCallback.java @ 486:6751ed7635f6
add foreground_service permission to manifest
author | Carl Byington <carl@five-ten-sg.com> |
---|---|
date | Wed, 14 Oct 2020 09:07:21 -0700 |
parents | d29cce60f393 |
children |
rev | line source |
---|---|
273
91a31873c42a
start conversion from trilead to ganymed
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
1 /* |
91a31873c42a
start conversion from trilead to ganymed
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
2 * Copyright (c) 2006-2011 Christian Plattner. All rights reserved. |
91a31873c42a
start conversion from trilead to ganymed
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
3 * Please refer to the LICENSE.txt for licensing details. |
91a31873c42a
start conversion from trilead to ganymed
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
4 */ |
91a31873c42a
start conversion from trilead to ganymed
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
5 package ch.ethz.ssh2; |
91a31873c42a
start conversion from trilead to ganymed
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
6 |
91a31873c42a
start conversion from trilead to ganymed
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
7 /** |
91a31873c42a
start conversion from trilead to ganymed
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
8 * An <code>InteractiveCallback</code> is used to respond to challenges sent |
91a31873c42a
start conversion from trilead to ganymed
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
9 * by the server if authentication mode "keyboard-interactive" is selected. |
307 | 10 * |
273
91a31873c42a
start conversion from trilead to ganymed
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
11 * @see Connection#authenticateWithKeyboardInteractive(String, |
91a31873c42a
start conversion from trilead to ganymed
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
12 * String[], InteractiveCallback) |
307 | 13 * |
273
91a31873c42a
start conversion from trilead to ganymed
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
14 * @author Christian Plattner |
91a31873c42a
start conversion from trilead to ganymed
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
15 * @version 2.50, 03/15/10 |
91a31873c42a
start conversion from trilead to ganymed
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
16 */ |
91a31873c42a
start conversion from trilead to ganymed
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
17 |
307 | 18 public interface InteractiveCallback { |
19 /** | |
20 * This callback interface is used during a "keyboard-interactive" | |
21 * authentication. Every time the server sends a set of challenges (however, | |
22 * most often just one challenge at a time), this callback function will be | |
23 * called to give your application a chance to talk to the user and to | |
24 * determine the response(s). | |
25 * <p> | |
26 * Some copy-paste information from the standard: a command line interface | |
27 * (CLI) client SHOULD print the name and instruction (if non-empty), adding | |
28 * newlines. Then for each prompt in turn, the client SHOULD display the | |
29 * prompt and read the user input. The name and instruction fields MAY be | |
30 * empty strings, the client MUST be prepared to handle this correctly. The | |
31 * prompt field(s) MUST NOT be empty strings. | |
32 * <p> | |
33 * Please refer to draft-ietf-secsh-auth-kbdinteract-XX.txt for the details. | |
34 * <p> | |
35 * Note: clients SHOULD use control character filtering as discussed in | |
36 * RFC4251 to avoid attacks by including | |
37 * terminal control characters in the fields to be displayed. | |
38 * | |
39 * @param name | |
40 * the name String sent by the server. | |
41 * @param instruction | |
42 * the instruction String sent by the server. | |
43 * @param numPrompts | |
44 * number of prompts - may be zero (in this case, you should just | |
45 * return a String array of length zero). | |
46 * @param prompt | |
47 * an array (length <code>numPrompts</code>) of Strings | |
48 * @param echo | |
49 * an array (length <code>numPrompts</code>) of booleans. For | |
50 * each prompt, the corresponding echo field indicates whether or | |
51 * not the user input should be echoed as characters are typed. | |
52 * @return an array of reponses - the array size must match the parameter | |
53 * <code>numPrompts</code>. | |
54 */ | |
55 public String[] replyToChallenge(String name, String instruction, int numPrompts, String[] prompt, boolean[] echo) | |
56 throws Exception; | |
273
91a31873c42a
start conversion from trilead to ganymed
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
57 } |