⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 basicservice.html

📁 JAVA CARD 开发包规格说明,版本为2.2.2
💻 HTML
📖 第 1 页 / 共 3 页
字号:
<TD><CODE><B><A HREF="../../../javacard/framework/service/BasicService.html#receiveInData(javacard.framework.APDU)">receiveInData</A></B>(<A HREF="../../../javacard/framework/APDU.html" title="class in javacard.framework">APDU</A>&nbsp;apdu)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Receives the input data for the command in the <CODE>APDU</CODE> object if the input has not already been received.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;boolean</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javacard/framework/service/BasicService.html#selectingApplet()">selectingApplet</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;This method is used to determine if the command in the <CODE>APDU</CODE> object  is the applet SELECT FILE command which selected the currently selected applet.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javacard/framework/service/BasicService.html#setOutputLength(javacard.framework.APDU, short)">setOutputLength</A></B>(<A HREF="../../../javacard/framework/APDU.html" title="class in javacard.framework">APDU</A>&nbsp;apdu,                short&nbsp;length)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets the output length of the outgoing response for the command in the <CODE>APDU</CODE> object.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javacard/framework/service/BasicService.html#setProcessed(javacard.framework.APDU)">setProcessed</A></B>(<A HREF="../../../javacard/framework/APDU.html" title="class in javacard.framework">APDU</A>&nbsp;apdu)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets the processing state of the command in the <CODE>APDU</CODE> object to <em>processed</em>.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javacard/framework/service/BasicService.html#setStatusWord(javacard.framework.APDU, short)">setStatusWord</A></B>(<A HREF="../../../javacard/framework/APDU.html" title="class in javacard.framework">APDU</A>&nbsp;apdu,              short&nbsp;sw)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets the response status word for the command in the <CODE>APDU</CODE> object.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;boolean</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javacard/framework/service/BasicService.html#succeed(javacard.framework.APDU)">succeed</A></B>(<A HREF="../../../javacard/framework/APDU.html" title="class in javacard.framework">APDU</A>&nbsp;apdu)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets the processing state for the command in the <CODE>APDU</CODE> object to <em>processed</em>, and indicates that the processing has succeeded.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;boolean</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javacard/framework/service/BasicService.html#succeedWithStatusWord(javacard.framework.APDU, short)">succeedWithStatusWord</A></B>(<A HREF="../../../javacard/framework/APDU.html" title="class in javacard.framework">APDU</A>&nbsp;apdu,                      short&nbsp;sw)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets the processing state for the command in the <CODE>APDU</CODE> object to <em>processed</em>, and indicates that the processing has partially succeeded.</TD></TR></TABLE>&nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TH ALIGN="left"><B>Methods inherited from class java.lang.<A HREF="../../../java/lang/Object.html" title="class in java.lang">Object</A></B></TH></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><A HREF="../../../java/lang/Object.html#equals(java.lang.Object)">equals</A></CODE></TD></TR></TABLE>&nbsp;<P><!-- ========= CONSTRUCTOR DETAIL ======== --><A NAME="constructor_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>Constructor Detail</B></FONT></TH></TR></TABLE><A NAME="BasicService()"><!-- --></A><H3>BasicService</H3><PRE>public <B>BasicService</B>()</PRE><DL><DD>Creates new <CODE>BasicService</CODE>.<P></DL><!-- ============ 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="processDataIn(javacard.framework.APDU)"><!-- --></A><H3>processDataIn</H3><PRE>public boolean <B>processDataIn</B>(<A HREF="../../../javacard/framework/APDU.html" title="class in javacard.framework">APDU</A>&nbsp;apdu)</PRE><DL><DD>This <CODE>BasicService</CODE> method is a default implementation and simply returns false without performing any processing.<P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../javacard/framework/service/Service.html#processDataIn(javacard.framework.APDU)">processDataIn</A></CODE> in interface <CODE><A HREF="../../../javacard/framework/service/Service.html" title="interface in javacard.framework.service">Service</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>apdu</CODE> - the <CODE>APDU</CODE> object containing the command being processed<DT><B>Returns:</B><DD><code>false</code></DL></DD></DL><HR><A NAME="processCommand(javacard.framework.APDU)"><!-- --></A><H3>processCommand</H3><PRE>public boolean <B>processCommand</B>(<A HREF="../../../javacard/framework/APDU.html" title="class in javacard.framework">APDU</A>&nbsp;apdu)</PRE><DL><DD>This <CODE>BasicService</CODE> method is a default implementation and simply returns false without performing any processing.<P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../javacard/framework/service/Service.html#processCommand(javacard.framework.APDU)">processCommand</A></CODE> in interface <CODE><A HREF="../../../javacard/framework/service/Service.html" title="interface in javacard.framework.service">Service</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>apdu</CODE> - the <CODE>APDU</CODE> object containing the command being processed<DT><B>Returns:</B><DD><code>false</code></DL></DD></DL><HR><A NAME="processDataOut(javacard.framework.APDU)"><!-- --></A><H3>processDataOut</H3><PRE>public boolean <B>processDataOut</B>(<A HREF="../../../javacard/framework/APDU.html" title="class in javacard.framework">APDU</A>&nbsp;apdu)</PRE><DL><DD>This <CODE>BasicService</CODE> method is a default implementation and simply returns false without performing any processing.<P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../javacard/framework/service/Service.html#processDataOut(javacard.framework.APDU)">processDataOut</A></CODE> in interface <CODE><A HREF="../../../javacard/framework/service/Service.html" title="interface in javacard.framework.service">Service</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>apdu</CODE> - the <CODE>APDU</CODE> object containing the command being processed<DT><B>Returns:</B><DD><code>false</code></DL></DD></DL><HR><A NAME="receiveInData(javacard.framework.APDU)"><!-- --></A><H3>receiveInData</H3><PRE>public short <B>receiveInData</B>(<A HREF="../../../javacard/framework/APDU.html" title="class in javacard.framework">APDU</A>&nbsp;apdu)                    throws <A HREF="../../../javacard/framework/service/ServiceException.html" title="class in javacard.framework.service">ServiceException</A></PRE><DL><DD>Receives the input data for the command in the <CODE>APDU</CODE> object if the input has not already been received. The entire input data must fit in the APDU buffer starting at offset 5. When invoked, the APDU object must either be in <CODE>STATE_INITIAL</CODE> with the APDU buffer in the Init format or in <CODE>STATE_FULL_INCOMING</CODE> with the APDU buffer in the Input Ready format<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>apdu</CODE> - the <CODE>APDU</CODE> object containing the apdu being processed<DT><B>Returns:</B><DD>the length of input data received and present in the APDU Buffer<DT><B>Throws:</B><DD><CODE><A HREF="../../../javacard/framework/service/ServiceException.html" title="class in javacard.framework.service">ServiceException</A></CODE> - with the following reason code:<ul> <li><code>ServiceException.CANNOT_ACCESS_IN_COMMAND</code> if the APDU object is not in STATE_INITIAL or in STATE_FULL_INCOMING or, <li><code>ServiceException.COMMAND_DATA_TOO_LONG</code> if the input data does not fit in the APDU buffer starting at offset 5. </ul></DL></DD></DL><HR><A NAME="setProcessed(javacard.framework.APDU)"><!-- --></A><H3>setProcessed</H3><PRE>public void <B>setProcessed</B>(<A HREF="../../../javacard/framework/APDU.html" title="class in javacard.framework">APDU</A>&nbsp;apdu)                  throws <A HREF="../../../javacard/framework/service/ServiceException.html" title="class in javacard.framework.service">ServiceException</A></PRE><DL><DD>Sets the processing state of the command in the <CODE>APDU</CODE> object to <em>processed</em>. This is done by setting the <CODE>APDU</CODE> object in outgoing mode by invoking the <code>APDU.setOutgoing</code> method. If the APDU is already in outgoing mode, this method does nothing (allowing the method to be called several times).<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>apdu</CODE> - the <CODE>APDU</CODE> object containing the command being processed<DT><B>Throws:</B><DD><CODE><A HREF="../../../javacard/framework/service/ServiceException.html" title="class in javacard.framework.service">ServiceException</A></CODE> - with the following reason code:<ul> <li><code>ServiceException.CANNOT_ACCESS_OUT_COMMAND</code> if the APDU object is not accessible (APDU object in STATE_ERROR_.. ) </ul><DT><B>See Also:</B><DD><A HREF="../../../javacard/framework/APDU.html#getCurrentState()"><CODE>javacard.framework.APDU.getCurrentState()</CODE></A></DL></DD></DL><HR><A NAME="isProcessed(javacard.framework.APDU)"><!-- --></A><H3>isProcessed</H3><PRE>public boolean <B>isProcessed</B>(<A HREF="../../../javacard/framework/APDU.html" title="class in javacard.framework">APDU</A>&nbsp;apdu)</PRE><DL><DD>Checks if the command in the <CODE>APDU</CODE> object has already been <em>processed</em>. This is done by checking whether or not the <CODE>APDU</CODE> object has been set in outgoing mode via a previous invocation of the <code>APDU.setOutgoing</code> method. <p>Note:<ul> <li><em>This method returns true if the APDU object is not accessible (APDU object in STATE_ERROR_.. ).</em> </ul><P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>apdu</CODE> - the <CODE>APDU</CODE> object containing the command being processed<DT><B>Returns:</B><DD><code>true</code> if the command has been <em>processed</em>, <CODE>false</CODE> otherwise</DL></DD></DL><HR><A NAME="setOutputLength(javacard.framework.APDU, short)"><!-- --></A><H3>setOutputLength</H3><PRE>public void <B>setOutputLength</B>(<A HREF="../../../javacard/framework/APDU.html" title="class in javacard.framework">APDU</A>&nbsp;apdu,                            short&nbsp;length)                     throws <A HREF="../../../javacard/framework/service/ServiceException.html" title="class in javacard.framework.service">ServiceException</A></PRE><DL><DD>Sets the output length of the outgoing response for the command in the <CODE>APDU</CODE> object. This method can be called regardless of the current state of the APDU processing.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>apdu</CODE> - the <CODE>APDU</CODE> object containing the command being processed<DD><CODE>length</CODE> - the number of bytes in the response to the command<DT><B>Throws:</B><DD><CODE><A HREF="../../../javacard/framework/service/ServiceException.html" title="class in javacard.framework.service">ServiceException</A></CODE> - with the following reason code:<ul> <li><code>ServiceException.ILLEGAL_PARAM</code> if the <code>length</code> parameter is greater than 256 or if the outgoing response will not fit within the APDU Buffer. </ul></DL></DD></DL><HR><A NAME="getOutputLength(javacard.framework.APDU)"><!-- --></A><H3>getOutputLength</H3><PRE>public short <B>getOutputLength</B>(<A HREF="../../../javacard/framework/APDU.html" title="class in javacard.framework">APDU</A>&nbsp;apdu)                      throws <A HREF="../../../javacard/framework/service/ServiceException.html" title="class in javacard.framework.service">ServiceException</A></PRE><DL><DD>Returns the output length for the command in the <CODE>APDU</CODE> object. This method can only be called if the APDU processing state indicates that the command has been <em>processed</em>.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>apdu</CODE> - the <CODE>APDU</CODE> object containing the command being processed<DT><B>Returns:</B><DD>a value in the range: 0 to 256(inclusive), that represents the number of bytes to be returned for this command<DT><B>Throws:</B><DD><CODE><A HREF="../../../javacard/framework/service/ServiceException.html" title="class in javacard.framework.service">ServiceException</A></CODE> - with the following reason code:<ul> <li><code>ServiceException.CANNOT_ACCESS_OUT_COMMAND</code> if the command is not <em>processed</em> or if the APDU object is not accessible (APDU object in STATE_ERROR_.. ) </ul><DT><B>See Also:</B><DD><A HREF="../../../javacard/framework/APDU.html#getCurrentState()"><CODE>javacard.framework.APDU.getCurrentState()</CODE></A></DL></DD></DL><HR><A NAME="setStatusWord(javacard.framework.APDU, short)"><!-- --></A><H3>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -