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

📄 cipher.html

📁 JAVA CARD 开发包规格说明,版本为2.2.2
💻 HTML
📖 第 1 页 / 共 4 页
字号:
</DL><HR><A NAME="ALG_DES_ECB_PKCS5"><!-- --></A><H3>ALG_DES_ECB_PKCS5</H3><PRE>public static final byte <B>ALG_DES_ECB_PKCS5</B></PRE><DL><DD>Cipher algorithm <code>ALG_DES_ECB_PKCS5</code> provides a cipher using DES in ECB 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_ECB_PKCS5">Constant Field Values</A></DL></DL><HR><A NAME="ALG_RSA_ISO14888"><!-- --></A><H3>ALG_RSA_ISO14888</H3><PRE>public static final byte <B>ALG_RSA_ISO14888</B></PRE><DL><DD>Cipher algorithm <code>ALG_RSA_ISO14888</code> provides a cipher using RSA, and pads   input data according to the ISO 14888 scheme.<P><DL><DT><B>See Also:</B><DD><A HREF="../../constant-values.html#javacardx.crypto.Cipher.ALG_RSA_ISO14888">Constant Field Values</A></DL></DL><HR><A NAME="ALG_RSA_PKCS1"><!-- --></A><H3>ALG_RSA_PKCS1</H3><PRE>public static final byte <B>ALG_RSA_PKCS1</B></PRE><DL><DD>Cipher algorithm <code>ALG_RSA_PKCS1</code> provides a cipher using RSA, and pads   input data according to the PKCS#1 (v1.5) scheme. <p>Note:<ul> <li><em>This algorithm is only suitable for messages of limited length. The total number of input bytes processed during encryption may not be more than k-11, where k is the RSA key's modulus size in bytes.</em><li><em> The encryption block(EB) during encryption with a Public key is built as follows:<br> &nbsp; EB = 00 || 02 || PS || 00 || M<br> &nbsp; &nbsp; &nbsp; :: M (input bytes) is the plaintext message<br> &nbsp; &nbsp; &nbsp; :: PS is an octet string of length k-3-||M|| of pseudo random nonzero octets. The length of PS must be at least 8 octets.<br> &nbsp; &nbsp; &nbsp; :: k is the RSA modulus size.</em><br> <li><em> The encryption block(EB) during encryption with a Private key (used to compute signatures when the message digest is computed off-card) is built as follows:<br> &nbsp; EB = 00 || 01 || PS || 00 || D<br> &nbsp; &nbsp; &nbsp; :: D (input bytes) is the DER encoding of the  hash computed elsewhere with an algorithm ID prepended if appropriate<br> &nbsp; &nbsp; &nbsp; :: PS is an octet string of length k-3-||D|| with value FF. The length of PS must be at least 8 octets.<br> &nbsp; &nbsp; &nbsp; :: k is the RSA modulus size.</em><br> </ul><P><DL><DT><B>See Also:</B><DD><A HREF="../../constant-values.html#javacardx.crypto.Cipher.ALG_RSA_PKCS1">Constant Field Values</A></DL></DL><HR><A NAME="ALG_RSA_ISO9796"><!-- --></A><H3>ALG_RSA_ISO9796</H3><PRE>public static final byte <B>ALG_RSA_ISO9796</B></PRE><DL><DD><B>Deprecated.</B>&nbsp;<I></I><DD>This Cipher algorithm <code>ALG_RSA_ISO9796</code> should not be used. The ISO 9796-1 algorithm was withdrawn by ISO in July 2000.<P><DL><DT><B>See Also:</B><DD><A HREF="../../constant-values.html#javacardx.crypto.Cipher.ALG_RSA_ISO9796">Constant Field Values</A></DL></DL><HR><A NAME="ALG_RSA_NOPAD"><!-- --></A><H3>ALG_RSA_NOPAD</H3><PRE>public static final byte <B>ALG_RSA_NOPAD</B></PRE><DL><DD>Cipher algorithm <code>ALG_RSA_NOPAD</code> provides a cipher using RSA and   does not pad input data. If the input data is bounded by incorrect padding bytes while using RSAPrivateCrtKey, incorrect output may result. If the input data is not 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_RSA_NOPAD">Constant Field Values</A></DL></DL><HR><A NAME="ALG_AES_BLOCK_128_CBC_NOPAD"><!-- --></A><H3>ALG_AES_BLOCK_128_CBC_NOPAD</H3><PRE>public static final byte <B>ALG_AES_BLOCK_128_CBC_NOPAD</B></PRE><DL><DD>Cipher algorithm <code>ALG_AES_BLOCK_128_CBC_NOPAD</code> provides a cipher using AES with block size 128 in CBC mode and   does not pad input data. If the input data is not 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_AES_BLOCK_128_CBC_NOPAD">Constant Field Values</A></DL></DL><HR><A NAME="ALG_AES_BLOCK_128_ECB_NOPAD"><!-- --></A><H3>ALG_AES_BLOCK_128_ECB_NOPAD</H3><PRE>public static final byte <B>ALG_AES_BLOCK_128_ECB_NOPAD</B></PRE><DL><DD>Cipher algorithm <code>ALG_AES_BLOCK_128_ECB_NOPAD</code> provides a cipher using AES with block size 128 in ECB mode and   does not pad input data. If the input data is not 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_AES_BLOCK_128_ECB_NOPAD">Constant Field Values</A></DL></DL><HR><A NAME="ALG_RSA_PKCS1_OAEP"><!-- --></A><H3>ALG_RSA_PKCS1_OAEP</H3><PRE>public static final byte <B>ALG_RSA_PKCS1_OAEP</B></PRE><DL><DD>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).<P><DL><DT><B>See Also:</B><DD><A HREF="../../constant-values.html#javacardx.crypto.Cipher.ALG_RSA_PKCS1_OAEP">Constant Field Values</A></DL></DL><HR><A NAME="ALG_KOREAN_SEED_ECB_NOPAD"><!-- --></A><H3>ALG_KOREAN_SEED_ECB_NOPAD</H3><PRE>public static final byte <B>ALG_KOREAN_SEED_ECB_NOPAD</B></PRE><DL><DD>Cipher algorithm <code>ALG_KOREAN_SEED_ECB_NOPAD</code> provides a cipher using the Korean SEED algorithm specified in the Korean SEED Algorithm specification provided by KISA, Korea Information Security Agency in ECB mode and   does not pad input data. If the input data is not 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_KOREAN_SEED_ECB_NOPAD">Constant Field Values</A></DL></DL><HR><A NAME="ALG_KOREAN_SEED_CBC_NOPAD"><!-- --></A><H3>ALG_KOREAN_SEED_CBC_NOPAD</H3><PRE>public static final byte <B>ALG_KOREAN_SEED_CBC_NOPAD</B></PRE><DL><DD>Cipher algorithm <code>ALG_KOREAN_SEED_CBC_NOPAD</code> provides a cipher using the Korean SEED algorithm specified in the Korean SEED Algorithm specification provided by KISA, Korea Information Security Agency in ECB mode and   does not pad input data. If the input data is not 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_KOREAN_SEED_CBC_NOPAD">Constant Field Values</A></DL></DL><HR><A NAME="MODE_DECRYPT"><!-- --></A><H3>MODE_DECRYPT</H3><PRE>public static final byte <B>MODE_DECRYPT</B></PRE><DL><DD>Used in <code>init()</code> methods to indicate decryption mode.<P><DL><DT><B>See Also:</B><DD><A HREF="../../constant-values.html#javacardx.crypto.Cipher.MODE_DECRYPT">Constant Field Values</A></DL></DL><HR><A NAME="MODE_ENCRYPT"><!-- --></A><H3>MODE_ENCRYPT</H3><PRE>public static final byte <B>MODE_ENCRYPT</B></PRE><DL><DD>Used in <code>init()</code> methods to indicate encryption mode.<P><DL><DT><B>See Also:</B><DD><A HREF="../../constant-values.html#javacardx.crypto.Cipher.MODE_ENCRYPT">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="Cipher()"><!-- --></A><H3>Cipher</H3><PRE>protected <B>Cipher</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="../../javacardx/crypto/Cipher.html" title="class in javacardx.crypto">Cipher</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>Cipher</code> object instance of the selected algorithm.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>algorithm</CODE> - the desired Cipher algorithm. Valid codes listed in <code>ALG_*</code> constants above, for example, <A HREF="../../javacardx/crypto/Cipher.html#ALG_DES_CBC_NOPAD"><CODE>ALG_DES_CBC_NOPAD</CODE></A>.<DD><CODE>externalAccess</CODE> - <code>true</code> indicates that the instance will be shared among multiple applet instances and that the <code>Cipher</code> instance will also be accessed (via a <code>Shareable</code> interface) when the owner of the <code>Cipher</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>Cipher</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 is not supported or shared access mode is not supported.</ul></DL></DD></DL><HR><A NAME="init(javacard.security.Key, byte)"><!-- --></A><H3>init</H3><PRE>public abstract void <B>init</B>(<A HREF="../../javacard/security/Key.html" title="interface in javacard.security">Key</A>&nbsp;theKey,                          byte&nbsp;theMode)                   throws <A HREF="../../javacard/security/CryptoException.html" title="class in javacard.security">CryptoException</A></PRE><DL><DD>Initializes the <code>Cipher</code> object with the appropriate <code>Key</code>. This method should be used for algorithms which do not need initialization parameters or use default parameter values. <p><code>init()</code> must be used to update the <code>Cipher</code> object with a new key. If the <code>Key</code> object is modified after invoking the <code>init()</code> method, the behavior of the <code>update()</code> and <code>doFinal()</code> methods is unspecified. <p>Note:<ul> <li><em>AES, DES, triple DES and Korean SEED algorithms in CBC mode will use 0 for initial vector(IV) if this method is used.</em>

⌨️ 快捷键说明

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