📄 eckey.html
字号:
setK</H3><PRE>void <B>setK</B>(short K)</PRE><DL><DD>Sets the cofactor of the order of the fixed point G of the curve. The cofactor need not be specified for the key to be initialized. However, the <code>KeyAgreement</code> algorithm type <CODE>ALG_EC_SVDP_DHC</CODE> requires that the cofactor, K, be initialized.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>K</CODE> - the value of the cofactor</DL></DD></DL><HR><A NAME="getField(byte[], short)"><!-- --></A><H3>getField</H3><PRE>short <B>getField</B>(byte[] buffer, short offset) throws <A HREF="../../javacard/security/CryptoException.html" title="class in javacard.security">CryptoException</A></PRE><DL><DD>Returns the field specification parameter value 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 the prime p corresponding to the field GF(p). For keys of type <CODE>TYPE_EC_F2M_PRIVATE</CODE> or <CODE>TYPE_EC_F2M_PUBLIC</CODE>, it is the value whose bit representation specifies the polynomial with binary coefficients used to define the arithmetic operations in the field GF(2^n) The plain text data format is big-endian and right-aligned (the least significant bit is the least significant bit of last byte).<P><DD><DL><DT><B>Parameters:</B><DD><CODE>buffer</CODE> - the output buffer<DD><CODE>offset</CODE> - the offset into the output buffer at which the parameter value is to begin<DT><B>Returns:</B><DD>the byte length of the parameter<DT><B>Throws:</B><DD><CODE><A HREF="../../javacard/security/CryptoException.html" title="class in javacard.security">CryptoException</A></CODE> - with the following reason code:<ul> <li><code>CryptoException.UNINITIALIZED_KEY</code> if the field specification parameter value of the key has not been successfully initialized since the time the initialized state of the key was set to false. </ul><DT><B>See Also:</B><DD><A HREF="../../javacard/security/Key.html" title="interface in javacard.security"><CODE>Key</CODE></A></DL></DD></DL><HR><A NAME="getA(byte[], short)"><!-- --></A><H3>getA</H3><PRE>short <B>getA</B>(byte[] buffer, short offset) throws <A HREF="../../javacard/security/CryptoException.html" title="class in javacard.security">CryptoException</A></PRE><DL><DD>Returns 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).<P><DD><DL><DT><B>Parameters:</B><DD><CODE>buffer</CODE> - the output buffer<DD><CODE>offset</CODE> - the offset into the output buffer at which the coefficient value is to begin<DT><B>Returns:</B><DD>the byte length of the coefficient<DT><B>Throws:</B><DD><CODE><A HREF="../../javacard/security/CryptoException.html" title="class in javacard.security">CryptoException</A></CODE> - with the following reason code:<ul> <li><code>CryptoException.UNINITIALIZED_KEY</code> if the coefficient of the curve of the key has not been successfully initialized since the time the initialized state of the key was set to false. </ul><DT><B>See Also:</B><DD><A HREF="../../javacard/security/Key.html" title="interface in javacard.security"><CODE>Key</CODE></A></DL></DD></DL><HR><A NAME="getB(byte[], short)"><!-- --></A><H3>getB</H3><PRE>short <B>getB</B>(byte[] buffer, short offset) throws <A HREF="../../javacard/security/CryptoException.html" title="class in javacard.security">CryptoException</A></PRE><DL><DD>Returns 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 0 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).<P><DD><DL><DT><B>Parameters:</B><DD><CODE>buffer</CODE> - the output buffer<DD><CODE>offset</CODE> - the offset into the output buffer at which the coefficient value is to begin<DT><B>Returns:</B><DD>the byte length of the coefficient<DT><B>Throws:</B><DD><CODE><A HREF="../../javacard/security/CryptoException.html" title="class in javacard.security">CryptoException</A></CODE> - with the following reason code:<ul> <li><code>CryptoException.UNINITIALIZED_KEY</code> if the second coefficient of the curve of the key has not been successfully initialized since the time the initialized state of the key was set to false. </ul><DT><B>See Also:</B><DD><A HREF="../../javacard/security/Key.html" title="interface in javacard.security"><CODE>Key</CODE></A></DL></DD></DL><HR><A NAME="getG(byte[], short)"><!-- --></A><H3>getG</H3><PRE>short <B>getG</B>(byte[] buffer, short offset) throws <A HREF="../../javacard/security/CryptoException.html" title="class in javacard.security">CryptoException</A></PRE><DL><DD>Returns the fixed point of the curve. The point is represented as an octet string in compressed or uncompressed forms as per ANSI X9.62. The plain text data format is big-endian and right-aligned (the least significant bit is the least significant bit of last byte).<P><DD><DL><DT><B>Parameters:</B><DD><CODE>buffer</CODE> - the output buffer<DD><CODE>offset</CODE> - the offset into the output buffer at which the point specification data is to begin<DT><B>Returns:</B><DD>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 code:<ul> <li><code>CryptoException.UNINITIALIZED_KEY</code> if the fixed point of the curve of the key has not been successfully initialized since the time the initialized state of the key was set to false. </ul><DT><B>See Also:</B><DD><A HREF="../../javacard/security/Key.html" title="interface in javacard.security"><CODE>Key</CODE></A></DL></DD></DL><HR><A NAME="getR(byte[], short)"><!-- --></A><H3>getR</H3><PRE>short <B>getR</B>(byte[] buffer, short offset) throws <A HREF="../../javacard/security/CryptoException.html" title="class in javacard.security">CryptoException</A></PRE><DL><DD>Returns 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).<P><DD><DL><DT><B>Parameters:</B><DD><CODE>buffer</CODE> - the output buffer<DD><CODE>offset</CODE> - the offset into the input buffer at which the order begins<DT><B>Returns:</B><DD>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 code:<ul> <li><code>CryptoException.UNINITIALIZED_KEY</code> if the order of the fixed point G of the curve of the key has not been successfully initialized since the time the initialized state of the key was set to false. </ul><DT><B>See Also:</B><DD><A HREF="../../javacard/security/Key.html" title="interface in javacard.security"><CODE>Key</CODE></A></DL></DD></DL><HR><A NAME="getK()"><!-- --></A><H3>getK</H3><PRE>short <B>getK</B>() throws <A HREF="../../javacard/security/CryptoException.html" title="class in javacard.security">CryptoException</A></PRE><DL><DD>Returns the cofactor of the order of the fixed point G of the curve.<P><DD><DL><DT><B>Returns:</B><DD>the value of the cofactor<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 the cofactor of the order of the fixed point G of the curve of the key has not been successfully initialized since the time the initialized state of the key was set to false. </ul><DT><B>See Also:</B><DD><A HREF="../../javacard/security/Key.html" title="interface in javacard.security"><CODE>Key</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> </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="class-use/ECKey.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </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>Java Card </b><br><font size="-1">v2.2.2</font></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../javacard/security/DSAPublicKey.html" title="interface in javacard.security"><B>PREV CLASS</B></A> <A HREF="../../javacard/security/ECPrivateKey.html" title="interface in javacard.security"><B>NEXT CLASS</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../index.html?javacard/security/ECKey.html" target="_top"><B>FRAMES</B></A> <A HREF="ECKey.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><i>Copyright © 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 + -