📄 messagedigest.html
字号:
<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="MessageDigest()"><!-- --></A><H3>MessageDigest</H3><PRE>protected <B>MessageDigest</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/MessageDigest.html" title="class in javacard.security">MessageDigest</A> <B>getInstance</B>(byte algorithm, boolean externalAccess) throws <A HREF="../../javacard/security/CryptoException.html" title="class in javacard.security">CryptoException</A></PRE><DL><DD>Creates a <code>MessageDigest</code> object instance of the selected algorithm.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>algorithm</CODE> - the desired message digest algorithm. Valid codes listed in <code>ALG_*</code> constants above, for example, <A HREF="../../javacard/security/MessageDigest.html#ALG_SHA"><CODE>ALG_SHA</CODE></A>.<DD><CODE>externalAccess</CODE> - <code>true</code> indicates that the instance will be shared among multiple applet instances and that the <code>MessageDigest</code> instance will also be accessed (via a <code>Shareable</code>. interface) when the owner of the <code>MessageDigest</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>MessageDigest</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="getInitializedMessageDigestInstance(byte, boolean)"><!-- --></A><H3>getInitializedMessageDigestInstance</H3><PRE>public static final <A HREF="../../javacard/security/InitializedMessageDigest.html" title="class in javacard.security">InitializedMessageDigest</A> <B>getInitializedMessageDigestInstance</B>(byte algorithm, boolean externalAccess) throws <A HREF="../../javacard/security/CryptoException.html" title="class in javacard.security">CryptoException</A></PRE><DL><DD>Creates a <code>InitializedMessageDigest</code> object instance of the selected algorithm.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>algorithm</CODE> - the desired message digest algorithm. Valid codes listed in <code>ALG_*</code> constants above, for example, <A HREF="../../javacard/security/MessageDigest.html#ALG_SHA"><CODE>ALG_SHA</CODE></A>.<DD><CODE>externalAccess</CODE> - <code>true</code> indicates that the instance will be shared among multiple applet instances and that the <code>InitializedMessageDigest</code> instance will also be accessed (via a <code>Shareable</code>. interface) when the owner of the <code>InitializedMessageDigest</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>InitializedMessageDigest</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><DT><B>Since:</B></DT> <DD>2.2.2</DD></DL></DD></DL><HR><A NAME="getAlgorithm()"><!-- --></A><H3>getAlgorithm</H3><PRE>public abstract byte <B>getAlgorithm</B>()</PRE><DL><DD>Gets the Message digest algorithm.<P><DD><DL><DT><B>Returns:</B><DD>the algorithm code defined above</DL></DD></DL><HR><A NAME="getLength()"><!-- --></A><H3>getLength</H3><PRE>public abstract byte <B>getLength</B>()</PRE><DL><DD>Returns the byte length of the hash.<P><DD><DL><DT><B>Returns:</B><DD>hash length</DL></DD></DL><HR><A NAME="doFinal(byte[], short, short, byte[], short)"><!-- --></A><H3>doFinal</H3><PRE>public abstract short <B>doFinal</B>(byte[] inBuff, short inOffset, short inLength, byte[] outBuff, short outOffset) throws <A HREF="../../javacard/security/CryptoException.html" title="class in javacard.security">CryptoException</A></PRE><DL><DD>Generates a hash of all/last input data. Completes and returns the hash computation after performing final operations such as padding. The <code>MessageDigest</code> object is reset to the initial state after this call is made. <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 hashed<DD><CODE>inOffset</CODE> - the offset into the input buffer at which to begin hash generation<DD><CODE>inLength</CODE> - the byte length to hash<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 hash value begins<DT><B>Returns:</B><DD>number of bytes of hash output in <code>outBuff</code><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_USE</code> if the accumulated message length is greater than the maximum length supported by the algorithm.</ul></DL></DD></DL><HR><A NAME="update(byte[], short, short)"><!-- --></A><H3>update</H3><PRE>public abstract void <B>update</B>(byte[] inBuff, short inOffset, short inLength) throws <A HREF="../../javacard/security/CryptoException.html" title="class in javacard.security">CryptoException</A></PRE><DL><DD>Accumulates a hash of the input data. This method requires temporary storage of intermediate results. In addition, if the input data length is not block aligned (multiple of block size) then additional internal storage may be allocated at this time to store a partial input data block. 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 hash is not available in one byte array. If all of the input data required for the hash is located in a single byte array, use of the <code>doFinal()</code> method is recommended. The <code>doFinal()</code> method must be called to complete processing of input data accumulated by one or more calls to the <code>update()</code> method. <p>Note:<ul> <li><em>If </em><code>inLength</code><em> 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 hashed<DD><CODE>inOffset</CODE> - the offset into the input buffer at which to begin hash generation<DD><CODE>inLength</CODE> - the byte length to hash<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_USE</code> if the accumulated message length is greater than the maximum length supported by the algorithm.</ul><DT><B>See Also:</B><DD><A HREF="../../javacard/security/MessageDigest.html#doFinal(byte[], short, short, byte[], short)"><CODE>doFinal</CODE></A></DL></DD></DL><HR><A NAME="reset()"><!-- --></A><H3>reset</H3><PRE>public abstract void <B>reset</B>()</PRE><DL><DD>Resets the <code>MessageDigest</code> object to the initial state for further use.<P><DD><DL></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> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/MessageDigest.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </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"> <A HREF="../../javacard/security/KoreanSEEDKey.html" title="interface in javacard.security"><B>PREV CLASS</B></A> <A HREF="../../javacard/security/PrivateKey.html" title="interface in javacard.security"><B>NEXT CLASS</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../index.html?javacard/security/MessageDigest.html" target="_top"><B>FRAMES</B></A> <A HREF="MessageDigest.html" target="_top"><B>NO FRAMES</B></A> <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: NESTED | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><A NAME="skip-navbar_bottom"></A><!-- ======== END OF BOTTOM NAVBAR ======= --><HR><i>Copyright © 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 + -