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

📄 keypair.html

📁 JAVA CARD 开发包规格说明,版本为2.2.2
💻 HTML
📖 第 1 页 / 共 2 页
字号:
<DL><DD><code>KeyPair</code> object containing a RSA key pair with private key in its Chinese Remainder Theorem form.<P><DL><DT><B>See Also:</B><DD><A HREF="../../constant-values.html#javacard.security.KeyPair.ALG_RSA_CRT">Constant Field Values</A></DL></DL><HR><A NAME="ALG_DSA"><!-- --></A><H3>ALG_DSA</H3><PRE>public static final byte <B>ALG_DSA</B></PRE><DL><DD><code>KeyPair</code> object containing a DSA key pair.<P><DL><DT><B>See Also:</B><DD><A HREF="../../constant-values.html#javacard.security.KeyPair.ALG_DSA">Constant Field Values</A></DL></DL><HR><A NAME="ALG_EC_F2M"><!-- --></A><H3>ALG_EC_F2M</H3><PRE>public static final byte <B>ALG_EC_F2M</B></PRE><DL><DD><CODE>KeyPair</CODE> object containing an EC key pair for EC operations over fields of characteristic 2 with polynomial basis.<P><DL><DT><B>See Also:</B><DD><A HREF="../../constant-values.html#javacard.security.KeyPair.ALG_EC_F2M">Constant Field Values</A></DL></DL><HR><A NAME="ALG_EC_FP"><!-- --></A><H3>ALG_EC_FP</H3><PRE>public static final byte <B>ALG_EC_FP</B></PRE><DL><DD><CODE>KeyPair</CODE> object containing an EC key pair for EC operations over large prime fields<P><DL><DT><B>See Also:</B><DD><A HREF="../../constant-values.html#javacard.security.KeyPair.ALG_EC_FP">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="KeyPair(byte, short)"><!-- --></A><H3>KeyPair</H3><PRE>public <B>KeyPair</B>(byte&nbsp;algorithm,               short&nbsp;keyLength)        throws <A HREF="../../javacard/security/CryptoException.html" title="class in javacard.security">CryptoException</A></PRE><DL><DD>Constructs a <code>KeyPair</code> instance for the specified algorithm and keylength;  the encapsulated keys are uninitialized. To initialize the <code>KeyPair</code> instance use the  <code>genKeyPair()</code> method.<p> The encapsulated key objects are of the specified <code>keyLength</code> size and implement the appropriate <code>Key</code> interface associated with the specified algorithm (example - <code>RSAPublicKey</code> interface for the public key and  <code>RSAPrivateKey</code> interface for the private key within an <code>ALG_RSA</code> key pair).<p> <p>Notes:<ul> <li><em>The key objects encapsulated in the generated </em><code>KeyPair</code><em> object need not support the </em><code>KeyEncryption</code><em> interface.</em> </ul><P><DL><DT><B>Parameters:</B><DD><CODE>algorithm</CODE> - the type of algorithm whose key pair needs to be generated. Valid codes listed in <code>ALG_*</code> constants above. See <A HREF="../../javacard/security/KeyPair.html#ALG_RSA"><CODE>ALG_RSA</CODE></A>.<DD><CODE>keyLength</CODE> - the key size in bits. The valid key bit lengths are key type dependent. See the <code>KeyBuilder</code> class.<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 associated with the specified type, size of key is not supported.</ul><DT><B>See Also:</B><DD><A HREF="../../javacard/security/KeyBuilder.html" title="class in javacard.security"><CODE>KeyBuilder</CODE></A>, <A HREF="../../javacard/security/Signature.html" title="class in javacard.security"><CODE>Signature</CODE></A>, <A HREF="../../javacardx/crypto/Cipher.html" title="class in javacardx.crypto"><CODE>javacardx.crypto.Cipher</CODE></A>, <A HREF="../../javacardx/crypto/KeyEncryption.html" title="interface in javacardx.crypto"><CODE>javacardx.crypto.KeyEncryption</CODE></A></DL></DL><HR><A NAME="KeyPair(javacard.security.PublicKey, javacard.security.PrivateKey)"><!-- --></A><H3>KeyPair</H3><PRE>public <B>KeyPair</B>(<A HREF="../../javacard/security/PublicKey.html" title="interface in javacard.security">PublicKey</A>&nbsp;publicKey,               <A HREF="../../javacard/security/PrivateKey.html" title="interface in javacard.security">PrivateKey</A>&nbsp;privateKey)        throws <A HREF="../../javacard/security/CryptoException.html" title="class in javacard.security">CryptoException</A></PRE><DL><DD>Constructs a new <code>KeyPair</code> object containing the specified  public key and private key. <p>Note that this constructor only stores references to the public and private key components in the generated <code>KeyPair</code> object. It does not throw an exception if the key parameter objects are uninitialized.<P><DL><DT><B>Parameters:</B><DD><CODE>publicKey</CODE> - the public key.<DD><CODE>privateKey</CODE> - the private key.<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 key objects are mismatched - different algorithms or different key sizes. Parameter values are not checked. <li><code>CryptoException.NO_SUCH_ALGORITHM</code> if the algorithm associated with the specified type, size of key is not supported. </ul></DL></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="genKeyPair()"><!-- --></A><H3>genKeyPair</H3><PRE>public final void <B>genKeyPair</B>()                      throws <A HREF="../../javacard/security/CryptoException.html" title="class in javacard.security">CryptoException</A></PRE><DL><DD>(Re)Initializes the key objects encapsulated in this <code>KeyPair</code> instance  with new key values. The initialized public and private key objects encapsulated in this instance will then be suitable for use with the <code>Signature</code>, <code>Cipher</code> and <code>KeyAgreement</code> objects.  An internal secure random number generator is used during new key pair generation. <p>Notes:<ul> <li><em>For the RSA algorithm, if the exponent value in the public key object is pre-initialized, it will be retained. Otherwise, a default value of 65537 will be used.</em> <li><em>For the DSA algorithm, if the p, q and g parameters of the public key object are pre-initialized, they will be retained. Otherwise, default precomputed parameter sets will be used. The required  default precomputed values are listed in </em>Appendix B<em> of </em>Java Cryptography Architecture API Specification & Reference<em> document.</em> <li><em>For the EC case, if the Field, A, B, G and R parameters of the public key object are pre-initialized, then they will be retained. Otherwise default pre-specified values MAY be used (e.g. WAP predefined curves), since computation of random generic EC keys is infeasible on the smart card platform.</em> <li><em>If the time taken to generate the key values is excessive, the implementation may automatically request additional APDU processing time from the CAD.</em> </ul><P><DD><DL><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 pre-initialized exponent  value parameter in the RSA public key or the pre-initialized p, q, g parameter set in the  DSA public key or the pre-initialized Field, A, B, G and R parameter set in public EC key  is invalid.</ul><DT><B>See Also:</B><DD><A HREF="../../javacard/framework/APDU.html" title="class in javacard.framework"><CODE>javacard.framework.APDU</CODE></A>, <A HREF="../../javacard/security/Signature.html" title="class in javacard.security"><CODE>Signature</CODE></A>, <A HREF="../../javacardx/crypto/Cipher.html" title="class in javacardx.crypto"><CODE>javacardx.crypto.Cipher</CODE></A>, <A HREF="../../javacard/security/RSAPublicKey.html" title="interface in javacard.security"><CODE>RSAPublicKey</CODE></A>, <A HREF="../../javacard/security/ECKey.html" title="interface in javacard.security"><CODE>ECKey</CODE></A>, <A HREF="../../javacard/security/DSAKey.html" title="interface in javacard.security"><CODE>DSAKey</CODE></A></DL></DD></DL><HR><A NAME="getPublic()"><!-- --></A><H3>getPublic</H3><PRE>public <A HREF="../../javacard/security/PublicKey.html" title="interface in javacard.security">PublicKey</A> <B>getPublic</B>()</PRE><DL><DD>Returns a reference to the public key component of this <code>KeyPair</code> object.<P><DD><DL><DT><B>Returns:</B><DD>a reference to the public key.</DL></DD></DL><HR><A NAME="getPrivate()"><!-- --></A><H3>getPrivate</H3><PRE>public <A HREF="../../javacard/security/PrivateKey.html" title="interface in javacard.security">PrivateKey</A> <B>getPrivate</B>()</PRE><DL><DD>Returns a reference to the private key component of this <code>KeyPair</code> object.<P><DD><DL><DT><B>Returns:</B><DD>a reference to the private key.</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>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/KeyPair.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</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">&nbsp;<A HREF="../../javacard/security/KeyBuilder.html" title="class in javacard.security"><B>PREV CLASS</B></A>&nbsp;&nbsp;<A HREF="../../javacard/security/KoreanSEEDKey.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/KeyPair.html" target="_top"><B>FRAMES</B></A>  &nbsp;&nbsp;<A HREF="KeyPair.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;&nbsp;<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:&nbsp;NESTED&nbsp;|&nbsp;<A HREF="#field_summary">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL:&nbsp;<A HREF="#field_detail">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><A NAME="skip-navbar_bottom"></A><!-- ======== END OF BOTTOM NAVBAR ======= --><HR><i>Copyright &#169; 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 + -