blob: d228c606edd3bf570979cf225f540dc18c672625 [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.5.0_12) on Tue Apr 01 14:48:49 CEST 2008 -->
<TITLE>
InteractiveCallback
</TITLE>
<META NAME="keywords" CONTENT="com.trilead.ssh2.InteractiveCallback interface">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
parent.document.title="InteractiveCallback";
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../com/trilead/ssh2/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/InteractiveCallback.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
Trilead SSH-2 for Java</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../com/trilead/ssh2/HTTPProxyException.html" title="class in com.trilead.ssh2"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../com/trilead/ssh2/KnownHosts.html" title="class in com.trilead.ssh2"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../index.html?com/trilead/ssh2/InteractiveCallback.html" target="_top"><B>FRAMES</B></A> &nbsp;
&nbsp;<A HREF="InteractiveCallback.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
&nbsp;<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->
<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
com.trilead.ssh2</FONT>
<BR>
Interface InteractiveCallback</H2>
<HR>
<DL>
<DT><PRE>public interface <B>InteractiveCallback</B></DL>
</PRE>
<P>
An <code>InteractiveCallback</code> is used to respond to challenges sent
by the server if authentication mode "keyboard-interactive" is selected.
<P>
<P>
<DL>
<DT><B>Version:</B></DT>
<DD>$Id: InteractiveCallback.java,v 1.1 2007/10/15 12:49:56 cplattne Exp $</DD>
<DT><B>Author:</B></DT>
<DD>Christian Plattner, plattner@trilead.com</DD>
<DT><B>See Also:</B><DD><A HREF="../../../com/trilead/ssh2/Connection.html#authenticateWithKeyboardInteractive(java.lang.String, java.lang.String[], com.trilead.ssh2.InteractiveCallback)"><CODE>Connection.authenticateWithKeyboardInteractive(String,
String[], InteractiveCallback)</CODE></A></DL>
<HR>
<P>
<!-- ========== METHOD SUMMARY =========== -->
<A NAME="method_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Method Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;java.lang.String[]</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/trilead/ssh2/InteractiveCallback.html#replyToChallenge(java.lang.String, java.lang.String, int, java.lang.String[], boolean[])">replyToChallenge</A></B>(java.lang.String&nbsp;name,
java.lang.String&nbsp;instruction,
int&nbsp;numPrompts,
java.lang.String[]&nbsp;prompt,
boolean[]&nbsp;echo)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;This callback interface is used during a "keyboard-interactive"
authentication.</TD>
</TR>
</TABLE>
&nbsp;
<P>
<!-- ============ METHOD DETAIL ========== -->
<A NAME="method_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Method Detail</B></FONT></TH>
</TR>
</TABLE>
<A NAME="replyToChallenge(java.lang.String, java.lang.String, int, java.lang.String[], boolean[])"><!-- --></A><H3>
replyToChallenge</H3>
<PRE>
java.lang.String[] <B>replyToChallenge</B>(java.lang.String&nbsp;name,
java.lang.String&nbsp;instruction,
int&nbsp;numPrompts,
java.lang.String[]&nbsp;prompt,
boolean[]&nbsp;echo)
throws java.lang.Exception</PRE>
<DL>
<DD>This callback interface is used during a "keyboard-interactive"
authentication. Every time the server sends a set of challenges (however,
most often just one challenge at a time), this callback function will be
called to give your application a chance to talk to the user and to
determine the response(s).
<p>
Some copy-paste information from the standard: a command line interface
(CLI) client SHOULD print the name and instruction (if non-empty), adding
newlines. Then for each prompt in turn, the client SHOULD display the
prompt and read the user input. The name and instruction fields MAY be
empty strings, the client MUST be prepared to handle this correctly. The
prompt field(s) MUST NOT be empty strings.
<p>
Please refer to draft-ietf-secsh-auth-kbdinteract-XX.txt for the details.
<p>
Note: clients SHOULD use control character filtering as discussed in
RFC4251 to avoid attacks by including
terminal control characters in the fields to be displayed.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>name</CODE> - the name String sent by the server.<DD><CODE>instruction</CODE> - the instruction String sent by the server.<DD><CODE>numPrompts</CODE> - number of prompts - may be zero (in this case, you should just
return a String array of length zero).<DD><CODE>prompt</CODE> - an array (length <code>numPrompts</code>) of Strings<DD><CODE>echo</CODE> - an array (length <code>numPrompts</code>) of booleans. For
each prompt, the corresponding echo field indicates whether or
not the user input should be echoed as characters are typed.
<DT><B>Returns:</B><DD>an array of reponses - the array size must match the parameter
<code>numPrompts</code>.
<DT><B>Throws:</B>
<DD><CODE>java.lang.Exception</CODE></DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../com/trilead/ssh2/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/InteractiveCallback.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
Trilead SSH-2 for Java</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../com/trilead/ssh2/HTTPProxyException.html" title="class in com.trilead.ssh2"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../com/trilead/ssh2/KnownHosts.html" title="class in com.trilead.ssh2"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../index.html?com/trilead/ssh2/InteractiveCallback.html" target="_top"><B>FRAMES</B></A> &nbsp;
&nbsp;<A HREF="InteractiveCallback.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
&nbsp;<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<HR>
</BODY>
</HTML>