📄 cipher.html
字号:
input data according to the ISO 14888 scheme.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static byte</CODE></FONT></TD><TD><CODE><B><A HREF="../../javacardx/crypto/Cipher.html#ALG_RSA_ISO9796">ALG_RSA_ISO9796</A></B></CODE><BR> <B>Deprecated.</B> <I></I> </TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static byte</CODE></FONT></TD><TD><CODE><B><A HREF="../../javacardx/crypto/Cipher.html#ALG_RSA_NOPAD">ALG_RSA_NOPAD</A></B></CODE><BR> Cipher algorithm <code>ALG_RSA_NOPAD</code> provides a cipher using RSA and does not pad input data.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static byte</CODE></FONT></TD><TD><CODE><B><A HREF="../../javacardx/crypto/Cipher.html#ALG_RSA_PKCS1">ALG_RSA_PKCS1</A></B></CODE><BR> Cipher algorithm <code>ALG_RSA_PKCS1</code> provides a cipher using RSA, and pads input data according to the PKCS#1 (v1.5) scheme.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static byte</CODE></FONT></TD><TD><CODE><B><A HREF="../../javacardx/crypto/Cipher.html#ALG_RSA_PKCS1_OAEP">ALG_RSA_PKCS1_OAEP</A></B></CODE><BR> Cipher algorithm <code>ALG_RSA_PKCS1_OAEP</code> provides a cipher using RSA, and pads input data according to the PKCS#1-OAEP scheme (IEEE 1363-2000).</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static byte</CODE></FONT></TD><TD><CODE><B><A HREF="../../javacardx/crypto/Cipher.html#MODE_DECRYPT">MODE_DECRYPT</A></B></CODE><BR> Used in <code>init()</code> methods to indicate decryption mode.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static byte</CODE></FONT></TD><TD><CODE><B><A HREF="../../javacardx/crypto/Cipher.html#MODE_ENCRYPT">MODE_ENCRYPT</A></B></CODE><BR> Used in <code>init()</code> methods to indicate encryption mode.</TD></TR></TABLE> <!-- ======== CONSTRUCTOR SUMMARY ======== --><A NAME="constructor_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>Constructor Summary</B></FONT></TH></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>protected </CODE></FONT></TD><TD><CODE><B><A HREF="../../javacardx/crypto/Cipher.html#Cipher()">Cipher</A></B>()</CODE><BR> Protected constructor.</TD></TR></TABLE> <!-- ========== 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>abstract short</CODE></FONT></TD><TD><CODE><B><A HREF="../../javacardx/crypto/Cipher.html#doFinal(byte[], short, short, byte[], short)">doFinal</A></B>(byte[] inBuff, short inOffset, short inLength, byte[] outBuff, short outOffset)</CODE><BR> Generates encrypted/decrypted output from all/last input data.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>abstract byte</CODE></FONT></TD><TD><CODE><B><A HREF="../../javacardx/crypto/Cipher.html#getAlgorithm()">getAlgorithm</A></B>()</CODE><BR> Gets the Cipher algorithm.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static <A HREF="../../javacardx/crypto/Cipher.html" title="class in javacardx.crypto">Cipher</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../javacardx/crypto/Cipher.html#getInstance(byte, boolean)">getInstance</A></B>(byte algorithm, boolean externalAccess)</CODE><BR> Creates a <code>Cipher</code> object instance of the selected algorithm.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>abstract void</CODE></FONT></TD><TD><CODE><B><A HREF="../../javacardx/crypto/Cipher.html#init(javacard.security.Key, byte)">init</A></B>(<A HREF="../../javacard/security/Key.html" title="interface in javacard.security">Key</A> theKey, byte theMode)</CODE><BR> Initializes the <code>Cipher</code> object with the appropriate <code>Key</code>.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>abstract void</CODE></FONT></TD><TD><CODE><B><A HREF="../../javacardx/crypto/Cipher.html#init(javacard.security.Key, byte, byte[], short, short)">init</A></B>(<A HREF="../../javacard/security/Key.html" title="interface in javacard.security">Key</A> theKey, byte theMode, byte[] bArray, short bOff, short bLen)</CODE><BR> Initializes the <code>Cipher</code> object with the appropriate Key and algorithm specific parameters.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>abstract short</CODE></FONT></TD><TD><CODE><B><A HREF="../../javacardx/crypto/Cipher.html#update(byte[], short, short, byte[], short)">update</A></B>(byte[] inBuff, short inOffset, short inLength, byte[] outBuff, short outOffset)</CODE><BR> Generates encrypted/decrypted output from input data.</TD></TR></TABLE> <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> <P><!-- ============ FIELD DETAIL =========== --><A NAME="field_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>Field Detail</B></FONT></TH></TR></TABLE><A NAME="ALG_DES_CBC_NOPAD"><!-- --></A><H3>ALG_DES_CBC_NOPAD</H3><PRE>public static final byte <B>ALG_DES_CBC_NOPAD</B></PRE><DL><DD>Cipher algorithm <code>ALG_DES_CBC_NOPAD</code> provides a cipher using DES in CBC mode or triple DES in outer CBC mode, and does not pad input data. If the input data is not (8-byte) block aligned it throws <code>CryptoException</code> with the reason code <code>ILLEGAL_USE</code>.<P><DL><DT><B>See Also:</B><DD><A HREF="../../constant-values.html#javacardx.crypto.Cipher.ALG_DES_CBC_NOPAD">Constant Field Values</A></DL></DL><HR><A NAME="ALG_DES_CBC_ISO9797_M1"><!-- --></A><H3>ALG_DES_CBC_ISO9797_M1</H3><PRE>public static final byte <B>ALG_DES_CBC_ISO9797_M1</B></PRE><DL><DD>Cipher algorithm <code>ALG_DES_CBC_ISO9797_M1</code> provides a cipher using DES in CBC mode or triple DES in outer CBC mode, and pads input data according to the ISO 9797 method 1 scheme.<P><DL><DT><B>See Also:</B><DD><A HREF="../../constant-values.html#javacardx.crypto.Cipher.ALG_DES_CBC_ISO9797_M1">Constant Field Values</A></DL></DL><HR><A NAME="ALG_DES_CBC_ISO9797_M2"><!-- --></A><H3>ALG_DES_CBC_ISO9797_M2</H3><PRE>public static final byte <B>ALG_DES_CBC_ISO9797_M2</B></PRE><DL><DD>Cipher algorithm <code>ALG_DES_CBC_ISO9797_M2</code> provides a cipher using DES in CBC mode or triple DES in outer CBC mode, and pads input data according to the ISO 9797 method 2 (ISO 7816-4, EMV'96) scheme.<P><DL><DT><B>See Also:</B><DD><A HREF="../../constant-values.html#javacardx.crypto.Cipher.ALG_DES_CBC_ISO9797_M2">Constant Field Values</A></DL></DL><HR><A NAME="ALG_DES_CBC_PKCS5"><!-- --></A><H3>ALG_DES_CBC_PKCS5</H3><PRE>public static final byte <B>ALG_DES_CBC_PKCS5</B></PRE><DL><DD>Cipher algorithm </code>ALG_DES_CBC_PKCS5</code> provides a cipher using DES in CBC mode or triple DES in outer CBC mode, and pads input data according to the PKCS#5 scheme.<P><DL><DT><B>See Also:</B><DD><A HREF="../../constant-values.html#javacardx.crypto.Cipher.ALG_DES_CBC_PKCS5">Constant Field Values</A></DL></DL><HR><A NAME="ALG_DES_ECB_NOPAD"><!-- --></A><H3>ALG_DES_ECB_NOPAD</H3><PRE>public static final byte <B>ALG_DES_ECB_NOPAD</B></PRE><DL><DD>Cipher algorithm <code>ALG_DES_ECB_NOPAD</code> provides a cipher using DES in ECB mode, and does not pad input data. If the input data is not (8-byte) block aligned it throws <code>CryptoException</code> with the reason code <code>ILLEGAL_USE</code>.<P><DL><DT><B>See Also:</B><DD><A HREF="../../constant-values.html#javacardx.crypto.Cipher.ALG_DES_ECB_NOPAD">Constant Field Values</A></DL></DL><HR><A NAME="ALG_DES_ECB_ISO9797_M1"><!-- --></A><H3>ALG_DES_ECB_ISO9797_M1</H3><PRE>public static final byte <B>ALG_DES_ECB_ISO9797_M1</B></PRE><DL><DD>Cipher algorithm <code>ALG_DES_ECB_ISO9797_M1</code> provides a cipher using DES in ECB mode, and pads input data according to the ISO 9797 method 1 scheme.<P><DL><DT><B>See Also:</B><DD><A HREF="../../constant-values.html#javacardx.crypto.Cipher.ALG_DES_ECB_ISO9797_M1">Constant Field Values</A></DL></DL><HR><A NAME="ALG_DES_ECB_ISO9797_M2"><!-- --></A><H3>ALG_DES_ECB_ISO9797_M2</H3><PRE>public static final byte <B>ALG_DES_ECB_ISO9797_M2</B></PRE><DL><DD>Cipher algorithm <code>ALG_DES_ECB_ISO9797_M2</code> provides a cipher using DES in ECB mode, and pads input data according to the ISO 9797 method 2 (ISO 7816-4, EMV'96) scheme.<P><DL><DT><B>See Also:</B><DD><A HREF="../../constant-values.html#javacardx.crypto.Cipher.ALG_DES_ECB_ISO9797_M2">Constant Field Values</A></DL>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -