📄 eckey.html
字号:
Sets the cofactor of the order of the fixed point G of the curve.</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="../../javacard/security/ECKey.html#setR(byte[], short, short)">setR</A></B>(byte[] buffer, short offset, short length)</CODE><BR> Sets the order of the fixed point G of the curve.</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="setFieldFP(byte[], short, short)"><!-- --></A><H3>setFieldFP</H3><PRE>void <B>setFieldFP</B>(byte[] buffer, short offset, short length) throws <A HREF="../../javacard/security/CryptoException.html" title="class in javacard.security">CryptoException</A></PRE><DL><DD>Sets the field specification parameter value for keys of type <CODE>TYPE_EC_FP_PRIVATE</CODE> or <CODE>TYPE_EC_FP_PUBLIC</CODE>. The specified value is the prime p corresponding to the field GF(p). The plain text data format is big-endian and right-aligned (the least significant bit is the least significant bit of last byte). Input parameter data is copied into the internal representation. <p>Note:<ul> <li><em>If the key object implements the </em><code>javacardx.crypto.KeyEncryption</code><em> interface and the </em><code>Cipher</code><em> object specified via </em><code>setKeyCipher()</code><em> is not </em><code>null</code><em>, the key value is decrypted using the </em><code>Cipher</code><em> object.</em> </ul><P><DD><DL><DT><B>Parameters:</B><DD><CODE>buffer</CODE> - the input buffer<DD><CODE>offset</CODE> - the offset into the input buffer at which the parameter value begins<DD><CODE>length</CODE> - the byte length of the parameter value<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_VALUE</code> if the input parameter data is inconsistent with the key length or if input data decryption is required and fails. <li><code>CryptoException.NO_SUCH_ALGORITHM</code> if the key is neither of type <code>TYPE_EC_FP_PUBLIC</code> nor <code>TYPE_EC_FP_PRIVATE</code>. </ul></DL></DD></DL><HR><A NAME="setFieldF2M(short)"><!-- --></A><H3>setFieldF2M</H3><PRE>void <B>setFieldF2M</B>(short e) throws <A HREF="../../javacard/security/CryptoException.html" title="class in javacard.security">CryptoException</A></PRE><DL><DD>Sets the field specification parameter value for keys of type <CODE>TYPE_EC_F2M_PUBLIC</CODE> or <CODE>TYPE_EC_F2M_PRIVATE</CODE> in the case where the polynomial is a trinomial, of the form x^n + x^e + 1 (where n is the bit length of the key). It is required that n > e > 0.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>e</CODE> - the value of the intermediate exponent of the trinomial<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_VALUE</code> if the input parameter e is not such that 0 < e < n. <li><code>CryptoException.NO_SUCH_ALGORITHM</code> if the key is neither of type <code>TYPE_EC_F2M_PUBLIC</code> nor <code>TYPE_EC_F2M_PRIVATE</code>. </ul></DL></DD></DL><HR><A NAME="setFieldF2M(short, short, short)"><!-- --></A><H3>setFieldF2M</H3><PRE>void <B>setFieldF2M</B>(short e1, short e2, short e3) throws <A HREF="../../javacard/security/CryptoException.html" title="class in javacard.security">CryptoException</A></PRE><DL><DD>Sets the field specification parameter value for keys of type <CODE>TYPE_EC_F2M_PUBLIC</CODE> or <CODE>TYPE_EC_F2M_PRIVATE</CODE> in the case where the polynomial is a pentanomial, of the form x^n + x^e1 + x^e2 + x^e3 + 1 (where n is the bit length of the key). It is required for all ei where ei = {e1, e2, e3} that n > ei > 0.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>e1</CODE> - the value of the first of the intermediate exponents of the pentanomial<DD><CODE>e2</CODE> - the value of the second of the intermediate exponent of the pentanomial<DD><CODE>e3</CODE> - the value of the third of the intermediate exponents<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_VALUE</code> if the input parameters ei where ei = {<code>e1</code>, <code>e2</code>, <code>e3</code>} are not such that for all ei, n > ei > 0. <li><code>CryptoException.NO_SUCH_ALGORITHM</code> if the key is neither of type <code>TYPE_EC_F2M_PUBLIC</code> nor <code>TYPE_EC_F2M_PRIVATE</code>. </ul></DL></DD></DL><HR><A NAME="setA(byte[], short, short)"><!-- --></A><H3>setA</H3><PRE>void <B>setA</B>(byte[] buffer, short offset, short length) throws <A HREF="../../javacard/security/CryptoException.html" title="class in javacard.security">CryptoException</A></PRE><DL><DD>Sets the first coefficient of the curve of the key. For keys of type <CODE>TYPE_EC_FP_PRIVATE</CODE> or <CODE>TYPE_EC_FP_PUBLIC</CODE>, this is the value of A as an integer modulo the field specification parameter p, that is, an integer in the range <CODE>0</CODE> to p-1. For keys of type <CODE>TYPE_EC_F2M_PRIVATE</CODE> or <code>TYPE_EC_F2M_PUBLIC</code>, the bit representation of this value specifies a polynomial with binary coefficients which represents the value of A in the field. The plain text data format is big-endian and right-aligned (the least significant bit is the least significant bit of last byte). Input parameter data is copied into the internal representation. <p>Note:<ul> <li><em>If the key object implements the </em><code>javacardx.crypto.KeyEncryption</code><em> interface and the </em><code>Cipher</code><em> object specified via </em><code>setKeyCipher()</code><em> is not </em><code>null</code><em>, the key value is decrypted using the </em><code>Cipher</code><em> object.</em> </ul><P><DD><DL><DT><B>Parameters:</B><DD><CODE>buffer</CODE> - the input buffer<DD><CODE>offset</CODE> - the offset into the input buffer at which the coefficient value begins<DD><CODE>length</CODE> - the byte length of the coefficient value<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_VALUE</code> if the input parameter data is inconsistent with the key length or if input data decryption is required and fails.</ul></DL></DD></DL><HR><A NAME="setB(byte[], short, short)"><!-- --></A><H3>setB</H3><PRE>void <B>setB</B>(byte[] buffer, short offset, short length) throws <A HREF="../../javacard/security/CryptoException.html" title="class in javacard.security">CryptoException</A></PRE><DL><DD>Sets the second coefficient of the curve of the key. For keys of type <CODE>TYPE_EC_FP_PRIVATE</CODE> or <CODE>TYPE_EC_FP_PUBLIC</CODE>, this is the value of B as an integer modulo the field specification parameter p, that is, an integer in the range <CODE>0</CODE> to p-1. For keys of type <CODE>TYPE_EC_F2M_PRIVATE</CODE> or <CODE>TYPE_EC_F2M_PUBLIC</CODE>, the bit representation of this value specifies a polynomial with binary coefficients which represents the value of B in the field. The plain text data format is big-endian and right-aligned (the least significant bit is the least significant bit of last byte). Input parameter data is copied into the internal representation. <p>Note:<ul> <li><em>If the key object implements the </em><code>javacardx.crypto.KeyEncryption</code><em> interface and the </em><code>Cipher</code><em> object specified via </em><code>setKeyCipher()</code><em> is not </em><code>null</code><em>, the key value is decrypted using the </em><code>Cipher</code><em> object.</em> </ul><P><DD><DL><DT><B>Parameters:</B><DD><CODE>buffer</CODE> - the input buffer<DD><CODE>offset</CODE> - the offset into the input buffer at which the coefficient value begins<DD><CODE>length</CODE> - the byte length of the coefficient value<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_VALUE</code> if the input parameter data is inconsistent with the key length or if input data decryption is required and fails.</ul></DL></DD></DL><HR><A NAME="setG(byte[], short, short)"><!-- --></A><H3>setG</H3><PRE>void <B>setG</B>(byte[] buffer, short offset, short length) throws <A HREF="../../javacard/security/CryptoException.html" title="class in javacard.security">CryptoException</A></PRE><DL><DD>Sets the fixed point of the curve. The point should be specified as an octet string as per ANSI X9.62. A specific implementation need not support the compressed form, but must support the uncompressed form of the point. The plain text data format is big-endian and right-aligned (the least significant bit is the least significant bit of last byte). Input parameter data is copied into the internal representation. <p>Note:<ul> <li><em>If the key object implements the </em><code>javacardx.crypto.KeyEncryption</code><em> interface and the </em><code>Cipher</code><em> object specified via </em><code>setKeyCipher()</code><em> is not </em><code>null</code><em>, the key value is decrypted using the </em><code>Cipher</code><em> object.</em> </ul><P><DD><DL><DT><B>Parameters:</B><DD><CODE>buffer</CODE> - the input buffer<DD><CODE>offset</CODE> - the offset into the input buffer at which the point specification begins<DD><CODE>length</CODE> - the byte length of the point specification<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_VALUE</code> if the input parameter data format is incorrect, or if the input parameter data is inconsistent with the key length, or if input data decryption is required and fails.</ul></DL></DD></DL><HR><A NAME="setR(byte[], short, short)"><!-- --></A><H3>setR</H3><PRE>void <B>setR</B>(byte[] buffer, short offset, short length) throws <A HREF="../../javacard/security/CryptoException.html" title="class in javacard.security">CryptoException</A></PRE><DL><DD>Sets the order of the fixed point G of the curve. The plain text data format is big-endian and right-aligned (the least significant bit is the least significant bit of last byte). Input parameter data is copied into the internal representation.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>buffer</CODE> - the input buffer<DD><CODE>offset</CODE> - the offset into the input buffer at which the order begins<DD><CODE>length</CODE> - the byte length of the order<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_VALUE</code> if the input parameter data is inconsistent with the key length, or if input data decryption is required and fails.</ul> <p>Note:<ul> <li><em>If the key object implements the </em><code>javacardx.crypto.KeyEncryption</code><em> interface and the </em><code>Cipher</code><em> object specified via </em><code>setKeyCipher()</code><em> is not </em><code>null</code><em>, the key value is decrypted using the </em><code>Cipher</code><em> object.</em> </ul></DL></DD></DL><HR><A NAME="setK(short)"><!-- --></A><H3>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -