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

📄 keypairgenerator.html

📁 API資料大全
💻 HTML
📖 第 1 页 / 共 2 页
字号:
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Constructor Detail</B></FONT></TD></TR></TABLE><A NAME="KeyPairGenerator(java.lang.String)"><!-- --></A><H3>KeyPairGenerator</H3><PRE>protected <B>KeyPairGenerator</B>(<A HREF="../../java/lang/String.html">String</A>&nbsp;algorithm)</PRE><DL><DD>Creates a KeyPairGenerator object for the specified algorithm.<DD><DL><DT><B>Parameters:</B><DD><CODE>algorithm</CODE> - the standard string name of the algorithm.  See Appendix A in the <a href= "../../../guide/security/CryptoSpec.html#AppA"> Java Cryptography Architecture API Specification &amp; Reference </a>  for information about standard algorithm names.</DL></DD></DL><!-- ============ METHOD DETAIL ========== --><A NAME="method_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Method Detail</B></FONT></TD></TR></TABLE><A NAME="getAlgorithm()"><!-- --></A><H3>getAlgorithm</H3><PRE>public <A HREF="../../java/lang/String.html">String</A> <B>getAlgorithm</B>()</PRE><DL><DD>Returns the standard name of the algorithm for this key pair generator. See Appendix A in the <a href= "../../../guide/security/CryptoSpec.html#AppA"> Java Cryptography Architecture API Specification &amp; Reference </a>  for information about standard algorithm names.<DD><DL><DT><B>Returns:</B><DD>the standard string name of the algorithm.</DL></DD></DL><HR><A NAME="getInstance(java.lang.String)"><!-- --></A><H3>getInstance</H3><PRE>public static <A HREF="../../java/security/KeyPairGenerator.html">KeyPairGenerator</A> <B>getInstance</B>(<A HREF="../../java/lang/String.html">String</A>&nbsp;algorithm)                                    throws <A HREF="../../java/security/NoSuchAlgorithmException.html">NoSuchAlgorithmException</A></PRE><DL><DD>Generates a KeyPairGenerator object that implements the specified digest algorithm. If the default provider package provides an implementation of the requested digest algorithm, an instance of KeyPairGenerator containing that implementation is returned. If the algorithm is not available in the default  package, other packages are searched.<DD><DL><DT><B>Parameters:</B><DD><CODE>algorithm</CODE> - the standard string name of the algorithm.  See Appendix A in the <a href= "../../../guide/security/CryptoSpec.html#AppA"> Java Cryptography Architecture API Specification &amp; Reference </a>  for information about standard algorithm names.<DT><B>Returns:</B><DD>the new KeyPairGenerator object.<DT><B>Throws:</B><DD><CODE><A HREF="../../java/security/NoSuchAlgorithmException.html">NoSuchAlgorithmException</A></CODE> - if the algorithm is not available in the environment.</DL></DD></DL><HR><A NAME="getInstance(java.lang.String, java.lang.String)"><!-- --></A><H3>getInstance</H3><PRE>public static <A HREF="../../java/security/KeyPairGenerator.html">KeyPairGenerator</A> <B>getInstance</B>(<A HREF="../../java/lang/String.html">String</A>&nbsp;algorithm,                                           <A HREF="../../java/lang/String.html">String</A>&nbsp;provider)                                    throws <A HREF="../../java/security/NoSuchAlgorithmException.html">NoSuchAlgorithmException</A>,                                           <A HREF="../../java/security/NoSuchProviderException.html">NoSuchProviderException</A></PRE><DL><DD>Generates a KeyPairGenerator object implementing the specified algorithm, as supplied from the specified provider,  if such an algorithm is available from the provider.<DD><DL><DT><B>Parameters:</B><DD><CODE>algorithm</CODE> - the standard string name of the algorithm. See Appendix A in the <a href= "../../../guide/security/CryptoSpec.html#AppA"> Java Cryptography Architecture API Specification &amp; Reference </a>  for information about standard algorithm names.<DD><CODE>provider</CODE> - the string name of the provider.<DT><B>Returns:</B><DD>the new KeyPairGenerator object.<DT><B>Throws:</B><DD><CODE><A HREF="../../java/security/NoSuchAlgorithmException.html">NoSuchAlgorithmException</A></CODE> - if the algorithm is not available from the provider.<DD><CODE><A HREF="../../java/security/NoSuchProviderException.html">NoSuchProviderException</A></CODE> - if the provider is not available in the environment.<DT><B>See Also: </B><DD><A HREF="../../java/security/Provider.html"><CODE>Provider</CODE></A></DL></DD></DL><HR><A NAME="getProvider()"><!-- --></A><H3>getProvider</H3><PRE>public final <A HREF="../../java/security/Provider.html">Provider</A> <B>getProvider</B>()</PRE><DL><DD>Returns the provider of this key pair generator object.<DD><DL><DT><B>Returns:</B><DD>the provider of this key pair generator object</DL></DD></DL><HR><A NAME="initialize(int)"><!-- --></A><H3>initialize</H3><PRE>public void <B>initialize</B>(int&nbsp;keysize)</PRE><DL><DD>Initializes the key pair generator for a certain keysize using a default parameter set and the <code>SecureRandom</code> implementation of the highest-priority installed provider as the source of randomness. (If none of the installed providers supply an implementation of <code>SecureRandom</code>, a system-provided source of randomness is used.)<DD><DL><DT><B>Parameters:</B><DD><CODE>keysize</CODE> - the keysize. This is an algorithm-specific metric, such as modulus length, specified in number of bits.<DT><B>Throws:</B><DD><CODE><A HREF="../../java/security/InvalidParameterException.html">InvalidParameterException</A></CODE> - if the <code>keysize</code> is not supported by this KeyPairGenerator object.</DL></DD></DL><HR><A NAME="initialize(int, java.security.SecureRandom)"><!-- --></A><H3>initialize</H3><PRE>public void <B>initialize</B>(int&nbsp;keysize,                       <A HREF="../../java/security/SecureRandom.html">SecureRandom</A>&nbsp;random)</PRE><DL><DD>Initializes the key pair generator for a certain keysize with the given source of randomness (and a default parameter set).<DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../java/security/KeyPairGeneratorSpi.html#initialize(int, java.security.SecureRandom)">initialize</A></CODE> in class <CODE><A HREF="../../java/security/KeyPairGeneratorSpi.html">KeyPairGeneratorSpi</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>keysize</CODE> - the keysize. This is an algorithm-specific metric, such as modulus length, specified in number of bits.<DD><CODE>random</CODE> - the source of randomness.<DT><B>Throws:</B><DD><CODE><A HREF="../../java/security/InvalidParameterException.html">InvalidParameterException</A></CODE> - if the <code>keysize</code> is not supported by this KeyPairGenerator object.<DT><B>Since: </B><DD>1.2</DD></DL></DD></DL><HR><A NAME="initialize(java.security.spec.AlgorithmParameterSpec)"><!-- --></A><H3>initialize</H3><PRE>public void <B>initialize</B>(<A HREF="../../java/security/spec/AlgorithmParameterSpec.html">AlgorithmParameterSpec</A>&nbsp;params)                throws <A HREF="../../java/security/InvalidAlgorithmParameterException.html">InvalidAlgorithmParameterException</A></PRE><DL><DD>Initializes the key pair generator using the specified parameter  set and the <code>SecureRandom</code> implementation of the highest-priority installed provider as the source of randomness. (If none of the installed providers supply an implementation of <code>SecureRandom</code>, a system-provided source of randomness is used.). <p>This concrete method has been added to this previously-defined abstract class. This method calls the KeyPairGeneratorSpi  <CODE>initialize(java.security.spec.AlgorithmParameterSpec, java.security.SecureRandom) initialize</CODE> method,  passing it <code>params</code> and a source of randomness (obtained from the highest-priority installed provider or system-provided if none of the installed providers supply one). That <code>initialize</code> method always throws an UnsupportedOperationException if it is not overridden by the provider.<DD><DL><DT><B>Parameters:</B><DD><CODE>params</CODE> - the parameter set used to generate the keys.<DT><B>Throws:</B><DD><CODE><A HREF="../../java/security/InvalidAlgorithmParameterException.html">InvalidAlgorithmParameterException</A></CODE> - if the given parameters are inappropriate for this key pair generator.<DT><B>Since: </B><DD>1.2</DD></DL></DD></DL><HR><A NAME="initialize(java.security.spec.AlgorithmParameterSpec, java.security.SecureRandom)"><!-- --></A><H3>initialize</H3><PRE>public void <B>initialize</B>(<A HREF="../../java/security/spec/AlgorithmParameterSpec.html">AlgorithmParameterSpec</A>&nbsp;params,                       <A HREF="../../java/security/SecureRandom.html">SecureRandom</A>&nbsp;random)                throws <A HREF="../../java/security/InvalidAlgorithmParameterException.html">InvalidAlgorithmParameterException</A></PRE><DL><DD>Initializes the key pair generator with the given parameter  set and source of randomness. <p>This concrete method has been added to this previously-defined abstract class. This method calls the KeyPairGeneratorSpi <CODE>initialize(java.security.spec.AlgorithmParameterSpec, java.security.SecureRandom) initialize</CODE> method,  passing it <code>params</code> and <code>random</code>. That <code>initialize</code> method always throws an UnsupportedOperationException if it is not overridden by the provider.<DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../java/security/KeyPairGeneratorSpi.html#initialize(java.security.spec.AlgorithmParameterSpec, java.security.SecureRandom)">initialize</A></CODE> in class <CODE><A HREF="../../java/security/KeyPairGeneratorSpi.html">KeyPairGeneratorSpi</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>params</CODE> - the parameter set used to generate the keys.<DD><CODE>random</CODE> - the source of randomness.<DT><B>Throws:</B><DD><CODE><A HREF="../../java/security/InvalidAlgorithmParameterException.html">InvalidAlgorithmParameterException</A></CODE> - if the given parameters are inappropriate for this key pair generator.<DT><B>Since: </B><DD>1.2</DD></DL></DD></DL><HR><A NAME="genKeyPair()"><!-- --></A><H3>genKeyPair</H3><PRE>public final <A HREF="../../java/security/KeyPair.html">KeyPair</A> <B>genKeyPair</B>()</PRE><DL><DD>Generates a key pair. <p>If this KeyPairGenerator has not been initialized explicitly, provider-specific defaults will be used for the size and other (algorithm-specific) values of the generated keys. <p>This will generate a new key pair every time it is called. <p>This method is functionally equivalent to  <A HREF="../../java/security/KeyPairGenerator.html#generateKeyPair()"><CODE>generateKeyPair</CODE></A>.<DD><DL><DT><B>Returns:</B><DD>the generated key pair<DT><B>Since: </B><DD>1.2</DD></DL></DD></DL><HR><A NAME="generateKeyPair()"><!-- --></A><H3>generateKeyPair</H3><PRE>public <A HREF="../../java/security/KeyPair.html">KeyPair</A> <B>generateKeyPair</B>()</PRE><DL><DD>Generates a key pair. <p>If this KeyPairGenerator has not been initialized explicitly, provider-specific defaults will be used for the size and other (algorithm-specific) values of the generated keys. <p>This will generate a new key pair every time it is called.  <p>This method is functionally equivalent to  <A HREF="../../java/security/KeyPairGenerator.html#genKeyPair()"><CODE>genKeyPair</CODE></A>.<DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../java/security/KeyPairGeneratorSpi.html#generateKeyPair()">generateKeyPair</A></CODE> in class <CODE><A HREF="../../java/security/KeyPairGeneratorSpi.html">KeyPairGeneratorSpi</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>the generated key pair</DL></DD></DL><!-- ========= END OF CLASS DATA ========= --><HR><!-- ========== START OF NAVBAR ========== --><A NAME="navbar_bottom"><!-- --></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0"><TR><TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_bottom_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3">  <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/KeyPairGenerator.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-files/index-1.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<sup><font size=-2>TM</font></sup>&nbsp;2&nbsp;Platform<br>Std.&nbsp;Ed. v1.3</b></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">&nbsp;<A HREF="../../java/security/KeyPair.html"><B>PREV CLASS</B></A>&nbsp;&nbsp;<A HREF="../../java/security/KeyPairGeneratorSpi.html"><B>NEXT CLASS</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">  <A HREF="../../index.html" TARGET="_top"><B>FRAMES</B></A>  &nbsp;&nbsp;<A HREF="KeyPairGenerator.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">  SUMMARY: &nbsp;INNER&nbsp;|&nbsp;FIELD&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;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><!-- =========== END OF NAVBAR =========== --><HR><font size="-1"><a href="http://java.sun.com/cgi-bin/bugreport.cgi">Submit a bug or feature</a><br>For further API reference and developer documentation, see <a href="http://java.sun.com/products/jdk/1.3/devdocs-vs-specs.html">Java 2 SDK SE Developer Documentation</a>. That documentation  contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples. <p>Java, Java 2D, and JDBC are trademarks or registered trademarks of Sun Microsystems, Inc. in the US and other countries.<br>Copyright 1993-2000 Sun Microsystems, Inc. 901 San Antonio Road<br>Palo Alto, California, 94303, U.S.A.  All Rights Reserved.</font></BODY></HTML>

⌨️ 快捷键说明

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