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

📄 signaturemessagerecovery.html

📁 JAVA CARD 开发包规格说明,版本为2.2.2
💻 HTML
📖 第 1 页 / 共 2 页
字号:
</DD></DL><HR><A NAME="beginVerify(byte[], short, short)"><!-- --></A><H3>beginVerify</H3><PRE>short <B>beginVerify</B>(byte[]&nbsp;sigAndRecDataBuff,                  short&nbsp;buffOffset,                  short&nbsp;sigLength)                  throws <A HREF="../../javacard/security/CryptoException.html" title="class in javacard.security">CryptoException</A></PRE><DL><DD>This method begins the verification sequence by recovering the message encoded within the signature itself and initializing the internal hash function. The recovered message data overwrites the signature data in the <code>sigAndRecDataBuff</code> input byte array. <p>Notes:<ul> <li><em>This method must be called during the verification sequence  prior to either the </em><code>update()</code><em> or the </em><code>verify()</code><em> methods during verification.</em> <li><em> The trailing (</em><code>sigLength</code><em> - recovered message length) bytes of  signature data in </em><code>sigAndRecDataBuff</code><em> may also be overwritten by this method.</em></ul><P><DD><DL><DT><B>Parameters:</B><DD><CODE>sigAndRecDataBuff</CODE> - contains the signature data as input and also  contains the recoverable part of the message as output.<DD><CODE>buffOffset</CODE> - offset into the sigAndRecDataBuff array where data begins  for signature and where this method will start writing recovered message data.<DD><CODE>sigLength</CODE> - the length of signature data<DT><B>Returns:</B><DD>byte length of recovered message data written to <code>sigAndRecDataBuff</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> for the following conditions:<ul> <li>if this object is initialized for signature sign mode <li>if <code>sigLength</code> is inconsistent with this <code>Signature</code> algorithm <li>if the decrypted message representative does not meet the algorithm specifications <li>if the bit length of the decrypted message representative is not a multiple of 8. </ul> <li><code>CryptoException.UNINITIALIZED_KEY</code> if key not initialized. <li><code>CryptoException.INVALID_INIT</code> if this <code>Signature</code> object is not initialized. </ul></DL></DD></DL><HR><A NAME="sign(byte[], short, short, byte[], short, short[], short)"><!-- --></A><H3>sign</H3><PRE>short <B>sign</B>(byte[]&nbsp;inBuff,           short&nbsp;inOffset,           short&nbsp;inLength,           byte[]&nbsp;sigBuff,           short&nbsp;sigOffset,           short[]&nbsp;recMsgLen,           short&nbsp;recMsgLenOffset)           throws <A HREF="../../javacard/security/CryptoException.html" title="class in javacard.security">CryptoException</A></PRE><DL><DD>Generates the signature of all/last input data. In addition, this method returns the number of bytes beginning with the first byte of the message that was encoded into the signature itself.  The encoded message is called the recoverable message and its length is called the recoverable message length. This recoverable message  need not be transmitted and can be recovered during verification. <p>A call to this method also resets this <code>Signature</code> object to the state it was in when previously initialized via a call to <code>init()</code>. That is, the object is reset and available to sign another message. <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 signed<DD><CODE>inOffset</CODE> - the offset into the input buffer at which to begin signature generation<DD><CODE>inLength</CODE> - the byte length to sign<DD><CODE>sigBuff</CODE> - the output buffer to store signature data<DD><CODE>sigOffset</CODE> - the offset into sigBuff at which to begin signature data<DD><CODE>recMsgLen</CODE> - the output buffer containing the number of bytes of the recoverable message beginning with the first byte of the message that was encoded into the signature itself<DD><CODE>recMsgLenOffset</CODE> - offset into the <code>recMsgLen</code> output buffer where the byte length of the recoverable message is stored. Note that a single short value is stored at <code>recMsgLenOffset</code> offset.<DT><B>Returns:</B><DD>number of bytes of signature output in sigBuff<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.UNINITIALIZED_KEY</code> if key not initialized. <li><code>CryptoException.INVALID_INIT</code> if this <code>Signature</code> object is not initialized or initialized for signature verify mode. </ul></DL></DD></DL><HR><A NAME="verify(byte[], short, short)"><!-- --></A><H3>verify</H3><PRE>boolean <B>verify</B>(byte[]&nbsp;inBuff,               short&nbsp;inOffset,               short&nbsp;inLength)               throws <A HREF="../../javacard/security/CryptoException.html" title="class in javacard.security">CryptoException</A></PRE><DL><DD>Verifies the signature of all/last input data against the passed in signature. <p>A call to this method also resets this <code>Signature</code> object to the state it was in when previously initialized via a call to <code>init()</code>. That is, the object is reset and available to verify another message.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>inBuff</CODE> - the input buffer of data to be verified<DD><CODE>inOffset</CODE> - the offset into the input buffer at which to begin signature generation<DD><CODE>inLength</CODE> - the byte length to sign<DT><B>Returns:</B><DD><code>true</code> if the signature verifies, <code>false</code> otherwise<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.UNINITIALIZED_KEY</code> if key not initialized. <li><code>CryptoException.INVALID_INIT</code> if this <code>Signature</code> object is not initialized or initialized for signature sign mode. <li><code>CryptoException.ILLEGAL_USE</code> if one of the following conditions is met:<ul> <li> if <code>beginVerify</code> method has not been called. </ul></DL></DD></DL><HR><A NAME="getAlgorithm()"><!-- --></A><H3>getAlgorithm</H3><PRE>byte <B>getAlgorithm</B>()</PRE><DL><DD>Gets the Signature algorithm.<P><DD><DL><DT><B>Returns:</B><DD>the algorithm code implemented by this <code>Signature</code> instance.</DL></DD></DL><HR><A NAME="getLength()"><!-- --></A><H3>getLength</H3><PRE>short <B>getLength</B>()                throws <A HREF="../../javacard/security/CryptoException.html" title="class in javacard.security">CryptoException</A></PRE><DL><DD>Returns the byte length of the signature data.<P><DD><DL><DT><B>Returns:</B><DD>the byte length of the signature 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.INVALID_INIT</code> if this <code>Signature</code> object is not initialized. <li><code>CryptoException.UNINITIALIZED_KEY</code> if key not initialized. </ul></DL></DD></DL><HR><A NAME="update(byte[], short, short)"><!-- --></A><H3>update</H3><PRE>void <B>update</B>(byte[]&nbsp;inBuff,            short&nbsp;inOffset,            short&nbsp;inLength)            throws <A HREF="../../javacard/security/CryptoException.html" title="class in javacard.security">CryptoException</A></PRE><DL><DD>Accumulates a signature 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 signing/verifying is not available in one byte array. If all of the input data required for  signing/verifying is located in a single byte array, use of the <code>sign()</code> or <code>beginVerify</code> method and <code>verify()</code> method is recommended. The <code>sign()</code> or <code>verify()</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 <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 signed/verified<DD><CODE>inOffset</CODE> - the offset into the input buffer where input data begins<DD><CODE>inLength</CODE> - the byte length to sign/verify<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.UNINITIALIZED_KEY</code> if key not initialized. <li><code>CryptoException.INVALID_INIT</code> if this <code>Signature</code> object is not initialized. <li><code>CryptoException.ILLEGAL_USE</code> if the mode set in the <code>init()</code> method is MODE_VERIFY and the <code>beginVerify()</code> method is not yet called.</ul><DT><B>See Also:</B><DD><A HREF="../../javacard/security/SignatureMessageRecovery.html#sign(byte[], short, short, byte[], short, short[], short)"><CODE>sign(byte[], short, short, byte[], short, short[], short)</CODE></A>, <A HREF="../../javacard/security/SignatureMessageRecovery.html#verify(byte[], short, short)"><CODE>verify(byte[], short, short)</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/SignatureMessageRecovery.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/Signature.html" title="class in javacard.security"><B>PREV CLASS</B></A>&nbsp;&nbsp;NEXT CLASS</FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">  <A HREF="../../index.html?javacard/security/SignatureMessageRecovery.html" target="_top"><B>FRAMES</B></A>  &nbsp;&nbsp;<A HREF="SignatureMessageRecovery.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><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 + -