📄 mac.html
字号:
<!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_08) on Wed Nov 07 10:29:38 EST 2007 --><TITLE>Mac (Bouncy Castle Library 1.38 API Specification)</TITLE><META NAME="keywords" CONTENT="org.bouncycastle.crypto.Mac interface"><LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style"><SCRIPT type="text/javascript">function windowTitle(){ parent.document.title="Mac (Bouncy Castle Library 1.38 API Specification)";}</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> </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="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>Bouncy Castle Cryptography Library 1.38</b></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../org/bouncycastle/crypto/KeyGenerationParameters.html" title="class in org.bouncycastle.crypto"><B>PREV CLASS</B></A> <A HREF="../../../org/bouncycastle/crypto/MaxBytesExceededException.html" title="class in org.bouncycastle.crypto"><B>NEXT CLASS</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../index.html?org/bouncycastle/crypto/Mac.html" target="_top"><B>FRAMES</B></A> <A HREF="Mac.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 | FIELD | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: FIELD | CONSTR | <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">org.bouncycastle.crypto</FONT><BR>Interface Mac</H2><DL><DT><B>All Known Implementing Classes:</B> <DD><A HREF="../../../org/bouncycastle/crypto/macs/BlockCipherMac.html" title="class in org.bouncycastle.crypto.macs">BlockCipherMac</A>, <A HREF="../../../org/bouncycastle/crypto/macs/CBCBlockCipherMac.html" title="class in org.bouncycastle.crypto.macs">CBCBlockCipherMac</A>, <A HREF="../../../org/bouncycastle/crypto/macs/CFBBlockCipherMac.html" title="class in org.bouncycastle.crypto.macs">CFBBlockCipherMac</A>, <A HREF="../../../org/bouncycastle/crypto/macs/CMac.html" title="class in org.bouncycastle.crypto.macs">CMac</A>, <A HREF="../../../org/bouncycastle/crypto/macs/GOST28147Mac.html" title="class in org.bouncycastle.crypto.macs">GOST28147Mac</A>, <A HREF="../../../org/bouncycastle/crypto/macs/HMac.html" title="class in org.bouncycastle.crypto.macs">HMac</A>, <A HREF="../../../org/bouncycastle/crypto/macs/ISO9797Alg3Mac.html" title="class in org.bouncycastle.crypto.macs">ISO9797Alg3Mac</A>, <A HREF="../../../org/bouncycastle/crypto/macs/OldHMac.html" title="class in org.bouncycastle.crypto.macs">OldHMac</A></DD></DL><HR><DL><DT><PRE>public interface <B>Mac</B></DL></PRE><P>The base interface for implementations of message authentication codes (MACs).<P><P><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> int</CODE></FONT></TD><TD><CODE><B><A HREF="../../../org/bouncycastle/crypto/Mac.html#doFinal(byte[], int)">doFinal</A></B>(byte[] out, int outOff)</CODE><BR> Compute the final statge of the MAC writing the output to the out parameter.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> java.lang.String</CODE></FONT></TD><TD><CODE><B><A HREF="../../../org/bouncycastle/crypto/Mac.html#getAlgorithmName()">getAlgorithmName</A></B>()</CODE><BR> Return the name of the algorithm the MAC implements.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> int</CODE></FONT></TD><TD><CODE><B><A HREF="../../../org/bouncycastle/crypto/Mac.html#getMacSize()">getMacSize</A></B>()</CODE><BR> Return the block size for this MAC (in bytes).</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../org/bouncycastle/crypto/Mac.html#init(org.bouncycastle.crypto.CipherParameters)">init</A></B>(<A HREF="../../../org/bouncycastle/crypto/CipherParameters.html" title="interface in org.bouncycastle.crypto">CipherParameters</A> params)</CODE><BR> Initialise the MAC.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../org/bouncycastle/crypto/Mac.html#reset()">reset</A></B>()</CODE><BR> Reset the MAC.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../org/bouncycastle/crypto/Mac.html#update(byte)">update</A></B>(byte in)</CODE><BR> add a single byte to the mac for processing.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../org/bouncycastle/crypto/Mac.html#update(byte[], int, int)">update</A></B>(byte[] in, int inOff, int len)</CODE><BR> </TD></TR></TABLE> <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="init(org.bouncycastle.crypto.CipherParameters)"><!-- --></A><H3>init</H3><PRE>void <B>init</B>(<A HREF="../../../org/bouncycastle/crypto/CipherParameters.html" title="interface in org.bouncycastle.crypto">CipherParameters</A> params) throws java.lang.IllegalArgumentException</PRE><DL><DD>Initialise the MAC.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>params</CODE> - the key and other data required by the MAC.<DT><B>Throws:</B><DD><CODE>java.lang.IllegalArgumentException</CODE> - if the params argument is inappropriate.</DL></DD></DL><HR><A NAME="getAlgorithmName()"><!-- --></A><H3>getAlgorithmName</H3><PRE>java.lang.String <B>getAlgorithmName</B>()</PRE><DL><DD>Return the name of the algorithm the MAC implements.<P><DD><DL><DT><B>Returns:</B><DD>the name of the algorithm the MAC implements.</DL></DD></DL><HR><A NAME="getMacSize()"><!-- --></A><H3>getMacSize</H3><PRE>int <B>getMacSize</B>()</PRE><DL><DD>Return the block size for this MAC (in bytes).<P><DD><DL><DT><B>Returns:</B><DD>the block size for this MAC in bytes.</DL></DD></DL><HR><A NAME="update(byte)"><!-- --></A><H3>update</H3><PRE>void <B>update</B>(byte in) throws java.lang.IllegalStateException</PRE><DL><DD>add a single byte to the mac for processing.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>in</CODE> - the byte to be processed.<DT><B>Throws:</B><DD><CODE>java.lang.IllegalStateException</CODE> - if the MAC is not initialised.</DL></DD></DL><HR><A NAME="update(byte[], int, int)"><!-- --></A><H3>update</H3><PRE>void <B>update</B>(byte[] in, int inOff, int len) throws <A HREF="../../../org/bouncycastle/crypto/DataLengthException.html" title="class in org.bouncycastle.crypto">DataLengthException</A>, java.lang.IllegalStateException</PRE><DL><DD><DL><DT><B>Parameters:</B><DD><CODE>in</CODE> - the array containing the input.<DD><CODE>inOff</CODE> - the index in the array the data begins at.<DD><CODE>len</CODE> - the length of the input starting at inOff.<DT><B>Throws:</B><DD><CODE>java.lang.IllegalStateException</CODE> - if the MAC is not initialised.<DD><CODE><A HREF="../../../org/bouncycastle/crypto/DataLengthException.html" title="class in org.bouncycastle.crypto">DataLengthException</A></CODE> - if there isn't enough data in in.</DL></DD></DL><HR><A NAME="doFinal(byte[], int)"><!-- --></A><H3>doFinal</H3><PRE>int <B>doFinal</B>(byte[] out, int outOff) throws <A HREF="../../../org/bouncycastle/crypto/DataLengthException.html" title="class in org.bouncycastle.crypto">DataLengthException</A>, java.lang.IllegalStateException</PRE><DL><DD>Compute the final statge of the MAC writing the output to the out parameter. <p> doFinal leaves the MAC in the same state it was after the last init.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>out</CODE> - the array the MAC is to be output to.<DD><CODE>outOff</CODE> - the offset into the out buffer the output is to start at.<DT><B>Throws:</B><DD><CODE><A HREF="../../../org/bouncycastle/crypto/DataLengthException.html" title="class in org.bouncycastle.crypto">DataLengthException</A></CODE> - if there isn't enough space in out.<DD><CODE>java.lang.IllegalStateException</CODE> - if the MAC is not initialised.</DL></DD></DL><HR><A NAME="reset()"><!-- --></A><H3>reset</H3><PRE>void <B>reset</B>()</PRE><DL><DD>Reset the MAC. At the end of resetting the MAC should be in the in the same state it was after the last init (if there was one).<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="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>Bouncy Castle Cryptography Library 1.38</b></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../org/bouncycastle/crypto/KeyGenerationParameters.html" title="class in org.bouncycastle.crypto"><B>PREV CLASS</B></A> <A HREF="../../../org/bouncycastle/crypto/MaxBytesExceededException.html" title="class in org.bouncycastle.crypto"><B>NEXT CLASS</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../index.html?org/bouncycastle/crypto/Mac.html" target="_top"><B>FRAMES</B></A> <A HREF="Mac.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 | FIELD | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: FIELD | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><A NAME="skip-navbar_bottom"></A><!-- ======== END OF BOTTOM NAVBAR ======= --><HR></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -