Mercurial > 510Connectbot
comparison src/ch/ethz/ssh2/ServerAuthenticationCallback.java @ 307:071eccdff8ea ganymed
fix java formatting
author | Carl Byington <carl@five-ten-sg.com> |
---|---|
date | Wed, 30 Jul 2014 14:16:58 -0700 |
parents | 91a31873c42a |
children |
comparison
equal
deleted
inserted
replaced
305:d2b303406d63 | 307:071eccdff8ea |
---|---|
5 | 5 |
6 package ch.ethz.ssh2; | 6 package ch.ethz.ssh2; |
7 | 7 |
8 /** | 8 /** |
9 * A callback used during the authentication phase (see RFC 4252) when | 9 * A callback used during the authentication phase (see RFC 4252) when |
10 * implementing a SSH server. | 10 * implementing a SSH server. |
11 * | 11 * |
12 * @author Christian Plattner | 12 * @author Christian Plattner |
13 * @version 2.50, 03/15/10 | 13 * @version 2.50, 03/15/10 |
14 */ | 14 */ |
15 public interface ServerAuthenticationCallback | 15 public interface ServerAuthenticationCallback { |
16 { | 16 /** |
17 /** | 17 * The method name for host-based authentication. |
18 * The method name for host-based authentication. | 18 */ |
19 */ | 19 public final String METHOD_HOSTBASED = "hostbased"; |
20 public final String METHOD_HOSTBASED = "hostbased"; | |
21 | 20 |
22 /** | 21 /** |
23 * The method name for public-key authentication. | 22 * The method name for public-key authentication. |
24 */ | 23 */ |
25 public final String METHOD_PUBLICKEY = "publickey"; | 24 public final String METHOD_PUBLICKEY = "publickey"; |
26 | 25 |
27 /** | 26 /** |
28 * The method name for password authentication. | 27 * The method name for password authentication. |
29 */ | 28 */ |
30 public final String METHOD_PASSWORD = "password"; | 29 public final String METHOD_PASSWORD = "password"; |
31 | 30 |
32 /** | 31 /** |
33 * Called when the client enters authentication. | 32 * Called when the client enters authentication. |
34 * This gives you the chance to set a custom authentication banner | 33 * This gives you the chance to set a custom authentication banner |
35 * for this SSH-2 session. This is the first method called in this interface. | 34 * for this SSH-2 session. This is the first method called in this interface. |
36 * It will only called at most once per <code>ServerConnection</code>. | 35 * It will only called at most once per <code>ServerConnection</code>. |
37 * | 36 * |
38 * @param sc The corresponding <code>ServerConnection</code> | 37 * @param sc The corresponding <code>ServerConnection</code> |
39 * @return The authentication banner or <code>NULL</code> in case no banner should be send. | 38 * @return The authentication banner or <code>NULL</code> in case no banner should be send. |
40 */ | 39 */ |
41 public String initAuthentication(ServerConnection sc); | 40 public String initAuthentication(ServerConnection sc); |
42 | 41 |
43 /** | 42 /** |
44 * Return the authentication methods that are currently available to the client. | 43 * Return the authentication methods that are currently available to the client. |
45 * Be prepared to return this information at any time during the authentication procedure. | 44 * Be prepared to return this information at any time during the authentication procedure. |
46 * <p/> | 45 * <p/> |
47 * The returned name-list of 'method names' (see RFC4252) indicate the authentication methods | 46 * The returned name-list of 'method names' (see RFC4252) indicate the authentication methods |
48 * that may productively continue the authentication dialog. | 47 * that may productively continue the authentication dialog. |
49 * </p> | 48 * </p> |
50 * It is RECOMMENDED that servers only include those 'method name' | 49 * It is RECOMMENDED that servers only include those 'method name' |
51 * values in the name-list that are actually useful. However, it is not | 50 * values in the name-list that are actually useful. However, it is not |
52 * illegal to include 'method name' values that cannot be used to | 51 * illegal to include 'method name' values that cannot be used to |
53 * authenticate the user. | 52 * authenticate the user. |
54 * <p/> | 53 * <p/> |
55 * Already successfully completed authentications SHOULD NOT be included | 54 * Already successfully completed authentications SHOULD NOT be included |
56 * in the name-list, unless they should be performed again for some reason. | 55 * in the name-list, unless they should be performed again for some reason. |
57 * | 56 * |
58 * @see #METHOD_HOSTBASED | 57 * @see #METHOD_HOSTBASED |
59 * @see #METHOD_PASSWORD | 58 * @see #METHOD_PASSWORD |
60 * @see #METHOD_PUBLICKEY | 59 * @see #METHOD_PUBLICKEY |
61 * | 60 * |
62 * @param sc | 61 * @param sc |
63 * @return A list of method names. | 62 * @return A list of method names. |
64 */ | 63 */ |
65 public String[] getRemainingAuthMethods(ServerConnection sc); | 64 public String[] getRemainingAuthMethods(ServerConnection sc); |
66 | 65 |
67 /** | 66 /** |
68 * Typically, this will be called be the client to get the list of | 67 * Typically, this will be called be the client to get the list of |
69 * authentication methods that can continue. You should simply return | 68 * authentication methods that can continue. You should simply return |
70 * {@link AuthenticationResult#FAILURE}. | 69 * {@link AuthenticationResult#FAILURE}. |
71 * | 70 * |
72 * @param sc | 71 * @param sc |
73 * @param username Name of the user that wants to log in with the "none" method. | 72 * @param username Name of the user that wants to log in with the "none" method. |
74 * @return | 73 * @return |
75 */ | 74 */ |
76 public AuthenticationResult authenticateWithNone(ServerConnection sc, String username); | 75 public AuthenticationResult authenticateWithNone(ServerConnection sc, String username); |
77 | 76 |
78 public AuthenticationResult authenticateWithPassword(ServerConnection sc, String username, String password); | 77 public AuthenticationResult authenticateWithPassword(ServerConnection sc, String username, String password); |
79 | 78 |
80 /** | 79 /** |
81 * NOTE: Not implemented yet. | 80 * NOTE: Not implemented yet. |
82 * | 81 * |
83 * @param sc | 82 * @param sc |
84 * @param username | 83 * @param username |
85 * @param algorithm | 84 * @param algorithm |
86 * @param publickey | 85 * @param publickey |
87 * @param signature | 86 * @param signature |
88 * @return | 87 * @return |
89 */ | 88 */ |
90 public AuthenticationResult authenticateWithPublicKey(ServerConnection sc, String username, String algorithm, | 89 public AuthenticationResult authenticateWithPublicKey(ServerConnection sc, String username, String algorithm, |
91 byte[] publickey, byte[] signature); | 90 byte[] publickey, byte[] signature); |
92 } | 91 } |