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

📄 checksum.html

📁 JAVA CARD 开发包规格说明,版本为2.2.2
💻 HTML
📖 第 1 页 / 共 2 页
字号:
 </ul> Algorithm specifics:<ul> <li>The input data is not reversed (reflected) <li>The ISO 3309 algorithm is used with the polynomial value <code>0x1021</code> <li>The resulting 16 bit FCS is not reversed (reflected) <li>The 16 bit FCS is xor'd with <code>OxFFFF</code>. This is the CRC16 result.</ul><P><DL><DT><B>See Also:</B><DD><A HREF="../../constant-values.html#javacard.security.Checksum.ALG_ISO3309_CRC16">Constant Field Values</A></DL></DL><HR><A NAME="ALG_ISO3309_CRC32"><!-- --></A><H3>ALG_ISO3309_CRC32</H3><PRE>public static final byte <B>ALG_ISO3309_CRC32</B></PRE><DL><DD>ISO/IEC 3309 compliant 32 bit CRC algorithm. This algorithm uses the generator polynomial : <code>X^32 +X^26 +X^23 +X^22 +X^16 +X^12 +X^11 +X^10 +X^8 +X^7 +X^5 +X^4 +X^2 +X +1</code>. The default initial checksum value used by this algorithm is 0. This algorithm is also compliant with the frame checking sequence as specified in  section 4.2.5.3 of the ISO/IEC 13239 specification.<p> To obtain the PKZIP (also JDK<sup>TM</sup> java.util.zip.CRC32 class) behavior: <ul> <li>Initialize with <code>0xFFFFFFFF</code> via the <code>init()</code> method  </ul> Algorithm specifics:<ul> <li>The input data is reversed (reflected) <li>The ISO 3309 algorithm is used with the polynomial value <code>0x04C11DB7</code> <li>The resulting 32 bit FCS is reversed (reflected) <li>The reversed 32 bit FCS is xor'd with OxFFFFFFFF. This is the CRC32 result.</ul><P><DL><DT><B>See Also:</B><DD><A HREF="../../constant-values.html#javacard.security.Checksum.ALG_ISO3309_CRC32">Constant Field Values</A></DL></DL><!-- ========= 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="Checksum()"><!-- --></A><H3>Checksum</H3><PRE>protected <B>Checksum</B>()</PRE><DL><DD>Protected Constructor<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="getInstance(byte, boolean)"><!-- --></A><H3>getInstance</H3><PRE>public static final <A HREF="../../javacard/security/Checksum.html" title="class in javacard.security">Checksum</A> <B>getInstance</B>(byte&nbsp;algorithm,                                         boolean&nbsp;externalAccess)                                  throws <A HREF="../../javacard/security/CryptoException.html" title="class in javacard.security">CryptoException</A></PRE><DL><DD>Creates a <code>Checksum</code> object instance of the selected algorithm.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>algorithm</CODE> - the desired checksum algorithm. Valid codes listed in <code>ALG_*</code> constants above, for example, <A HREF="../../javacard/security/Checksum.html#ALG_ISO3309_CRC16"><CODE>ALG_ISO3309_CRC16</CODE></A>.<DD><CODE>externalAccess</CODE> - <code>true</code> indicates that the instance will be shared among multiple applet instances and that the <code>Checksum</code> instance will also be accessed (via a <code>Shareable</code>. interface) when the owner of the <code>Checksum</code> instance is not the currently selected applet. If <code>true</code> the implementation must not allocate CLEAR_ON_DESELECT transient space for internal data.<DT><B>Returns:</B><DD>the <code>Checksum</code> object instance of the requested algorithm.<DT><B>Throws:</B><DD><CODE><A HREF="../../javacard/security/CryptoException.html" title="class in javacard.security">CryptoException</A></CODE> - with the following reason codes:<ul> <li><code>CryptoException.NO_SUCH_ALGORITHM</code> if the requested algorithm or shared access mode is not supported.</ul></DL></DD></DL><HR><A NAME="init(byte[], short, short)"><!-- --></A><H3>init</H3><PRE>public abstract void <B>init</B>(byte[]&nbsp;bArray,                          short&nbsp;bOff,                          short&nbsp;bLen)                   throws <A HREF="../../javacard/security/CryptoException.html" title="class in javacard.security">CryptoException</A></PRE><DL><DD>Resets and initializes the <code>Checksum</code> object with the algorithm specific parameters. <p>Note:<ul> <li><em>The ALG_ISO3309_CRC16 algorithm expects 2 bytes of parameter information in  </em><code>bArray</code><em> representing the initial checksum value.</em> <li><em>The ALG_ISO3309_CRC32 algorithm expects 4 bytes of parameter information in  </em><code>bArray</code><em> representing the initial checksum value.</em> </ul><P><DD><DL><DT><B>Parameters:</B><DD><CODE>bArray</CODE> - byte array containing algorithm specific initialization information<DD><CODE>bOff</CODE> - offset within <code>bArray</code> where the algorithm specific data begins<DD><CODE>bLen</CODE> - byte length of algorithm specific parameter data<DT><B>Throws:</B><DD><CODE><A HREF="../../javacard/security/CryptoException.html" title="class in javacard.security">CryptoException</A></CODE> - with the following reason codes:<ul> <li><code>CryptoException.ILLEGAL_VALUE</code> if a byte array parameter option is not supported by the algorithm or if the <code>bLen</code> is an incorrect byte length for the algorithm specific data. </ul></DL></DD></DL><HR><A NAME="getAlgorithm()"><!-- --></A><H3>getAlgorithm</H3><PRE>public abstract byte <B>getAlgorithm</B>()</PRE><DL><DD>Gets the Checksum algorithm. Valid codes listed in <code>ALG_*</code> constants above, for example, <A HREF="../../javacard/security/Checksum.html#ALG_ISO3309_CRC16"><CODE>ALG_ISO3309_CRC16</CODE></A>.<P><DD><DL><DT><B>Returns:</B><DD>the algorithm code defined above</DL></DD></DL><HR><A NAME="doFinal(byte[], short, short, byte[], short)"><!-- --></A><H3>doFinal</H3><PRE>public abstract short <B>doFinal</B>(byte[]&nbsp;inBuff,                              short&nbsp;inOffset,                              short&nbsp;inLength,                              byte[]&nbsp;outBuff,                              short&nbsp;outOffset)</PRE><DL><DD>Generates a CRC checksum of all/last input data. The CRC engine processes input data starting with the byte at offset <CODE>inOffset</CODE> and continuing on until the byte at <CODE>(inOffset+inLength-1)</CODE> of the <CODE>inBuff</CODE> array. Within each byte the processing proceeds from the least significant bit to the most. <p>Completes and returns the checksum computation. The <code>Checksum</code> object is reset to the initial state(state upon construction) when this method completes. <p>Note:<ul> <li><em>The <CODE>ALG_ISO3309_CRC16</CODE> and <CODE>ALG_ISO3309_CRC32</CODE> algorithms reset the initial checksum value to 0. The initial checksum value can be re-initialized using the </em><A HREF="../../javacard/security/Checksum.html#init(byte[], short, short)"><CODE>init(byte[], short, short)</CODE></A> <em> method.</em> </ul> <p>The input and output buffer data may overlap.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>inBuff</CODE> - the input buffer of data to be checksummed<DD><CODE>inOffset</CODE> - the offset into the input buffer at which to begin checksum generation<DD><CODE>inLength</CODE> - the byte length to checksum<DD><CODE>outBuff</CODE> - the output buffer, may be the same as the input buffer<DD><CODE>outOffset</CODE> - the offset into the output buffer where the resulting checksum value begins<DT><B>Returns:</B><DD>number of bytes of checksum output in <code>outBuff</code></DL></DD></DL><HR><A NAME="update(byte[], short, short)"><!-- --></A><H3>update</H3><PRE>public abstract void <B>update</B>(byte[]&nbsp;inBuff,                            short&nbsp;inOffset,                            short&nbsp;inLength)</PRE><DL><DD>Accumulates a partial checksum of the input data. The CRC engine processes input data starting with the byte at offset <CODE>inOffset</CODE> and continuing on until the byte at <CODE>(inOffset+inLength-1)</CODE> of the <CODE>inBuff</CODE> array. Within each byte the processing proceeds from the least significant bit to the most. <p>This method requires temporary storage of intermediate results.  This may result in additional resource consumption and/or slow performance. This method should only be used if all the input data required for the checksum is not available in one byte array. The <A HREF="../../javacard/security/Checksum.html#doFinal(byte[], short, short, byte[], short)"><CODE>doFinal(byte[], short, short, byte[], short)</CODE></A> method is recommended whenever possible. <p>Note:<ul> <li><em>If <code>inLength</code> is 0 this method does nothing.</em> </ul><P><DD><DL><DT><B>Parameters:</B><DD><CODE>inBuff</CODE> - the input buffer of data to be checksummed<DD><CODE>inOffset</CODE> - the offset into the input buffer at which to begin checksum generation<DD><CODE>inLength</CODE> - the byte length to checksum<DT><B>See Also:</B><DD><A HREF="../../javacard/security/Checksum.html#doFinal(byte[], short, short, byte[], short)"><CODE>doFinal</CODE></A></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="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/Checksum.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><b>Java Card </b><br><font size="-1">v2.2.2</font></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">&nbsp;<A HREF="../../javacard/security/AESKey.html" title="interface in javacard.security"><B>PREV CLASS</B></A>&nbsp;&nbsp;<A HREF="../../javacard/security/CryptoException.html" title="class in javacard.security"><B>NEXT CLASS</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">  <A HREF="../../index.html?javacard/security/Checksum.html" target="_top"><B>FRAMES</B></A>  &nbsp;&nbsp;<A HREF="Checksum.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;<A HREF="#field_summary">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL:&nbsp;<A HREF="#field_detail">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><A NAME="skip-navbar_bottom"></A><!-- ======== END OF BOTTOM NAVBAR ======= --><HR><i>Copyright &#169; 1993-2005 Sun Microsystems, Inc. 4150 Network Circle,<br>Santa Clara, CA, 95054, U.S.A.  All Rights Reserved.</i></BODY></HTML>

⌨️ 快捷键说明

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