<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<!--NewPage-->
<html>
<head>
<!-- Generated by javadoc on Wed Jul 28 01:21:15 GMT 1999 -->
<title>
  Interface java.security.interfaces.DSAKeyPairGenerator
</title>
</head>
<body>
<a name="_top_"></a>
<pre>
<a href="packages.html">All Packages</a>  <a href="tree.html">Class Hierarchy</a>  <a href="Package-java.security.interfaces.html">This Package</a>  <a href="java.security.interfaces.DSAKey.html#_top_">Previous</a>  <a href="java.security.interfaces.DSAParams.html#_top_">Next</a>  <a href="AllNames.html">Index</a></pre>
<hr>
<h1>
  Interface java.security.interfaces.DSAKeyPairGenerator
</h1>
<dl>
  <dt> public interface <b>DSAKeyPairGenerator</b>
</dl>
An interface to an object capable of generating DSA key pairs. 
 <p>The <code>initialize</code> methods may each be called any number 
 of times. If no <code>initialize</code> method is called on a 
 DSAKeyPairGenerator, the default is to generate 1024-bit keys, using 
 precomputed p, q and g parameters and an instance of SecureRandom as 
 the random bit source.
 <p>Users wishing to indicate DSA-specific parameters, and to generate a key 
 pair suitable for use with the DSA algorithm typically
 <ol>
 <li>Get a key pair generator for the DSA algorithm by calling the 
 KeyPairGenerator <code>getInstance</code> method with "DSA" 
 as its argument.<p> 
 <li>Initialize the generator by casting the result to a DSAKeyPairGenerator
 and calling one of the 
 <code>initialize</code> methods from this DSAKeyPairGenerator interface.<p>
 <li>Generate a key pair by calling the <code>generateKeyPair</code> 
 method from the KeyPairGenerator class.
 </ol> 
 <p>Note: it is not always necessary to do do algorithm-specific
 initialization for a DSA key pair generator. That is, it is not always
 necessary to call an <code>initialize</code> method in this interface.
 Algorithm-independent initialization using the <code>initialize</code> method
 in the KeyPairGenerator
 interface is all that is needed when you accept defaults for algorithm-specific
 parameters.
<p>
<dl>
    <dt> <b>See Also:</b>
    <dd> <a href="java.security.KeyPairGenerator.html#_top_">KeyPairGenerator</a>
</dl>
<hr>
<a name="index"></a>
<h2>
  <img src="images/method-index.gif" width=207 height=38 alt="Method Index">
</h2>
<dl>
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#initialize(java.security.interfaces.DSAParams, java.security.SecureRandom)"><b>initialize</b></a>(DSAParams, SecureRandom)
  <dd>  Initializes the key pair generator using p, q and g, the DSA
 family parameters.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#initialize(int, boolean, java.security.SecureRandom)"><b>initialize</b></a>(int, boolean, SecureRandom)
  <dd>  Initializes the key pair generator for a given modulus length,
 without parameters.
</dl>
<a name="methods"></a>
<h2>
  <img src="images/methods.gif" width=151 height=38 alt="Methods">
</h2>
<a name="initialize(java.security.interfaces.DSAParams, java.security.SecureRandom)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="initialize"><b>initialize</b></a>
<pre>
 public abstract void initialize(<a href="java.security.interfaces.DSAParams.html#_top_">DSAParams</a> params,
                                 <a href="java.security.SecureRandom.html#_top_">SecureRandom</a> random) throws <a href="java.security.InvalidParameterException.html#_top_">InvalidParameterException</a>
</pre>
<dl>
  <dd> Initializes the key pair generator using p, q and g, the DSA
 family parameters.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> params - the parameters to use to generate the keys.
    <dd> random - the random bit source to use to generate
 key bits.
    <dt> <b>Throws:</b> <a href="java.security.InvalidParameterException.html#_top_">InvalidParameterException</a>
    <dd> if the parameters passed are
 invalid or null.
  </dl></dd>
</dl>
<a name="initialize(int, boolean, java.security.SecureRandom)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="initialize"><b>initialize</b></a>
<pre>
 public abstract void initialize(int modlen,
                                 boolean genParams,
                                 <a href="java.security.SecureRandom.html#_top_">SecureRandom</a> random) throws <a href="java.security.InvalidParameterException.html#_top_">InvalidParameterException</a>
</pre>
<dl>
  <dd> Initializes the key pair generator for a given modulus length,
 without parameters. 
 <p>If <code>genParams</code> is true, this method will generate new 
 p, q and g parameters. If it is false, the method will use precomputed
 parameters for the modulus length requested. If there are no
 precomputed parameters for that modulus length, an exception will be 
 thrown. It is guaranteed that there will always be
 default parameters for modulus lengths of 512 and 1024 bits.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> modlen - the modulus length, in bits. Valid values are any
 multiple of 8 between 512 and 1024, inclusive.
    <dd> random - the random bit source to use to generate
 key bits.
    <dd> genParams - whether or not to generate new parameters for
 the modulus length requested.
    <dt> <b>Throws:</b> <a href="java.security.InvalidParameterException.html#_top_">InvalidParameterException</a>
    <dd> if the modulus length is not
 between 512 and 1024, or if genParams is false and there are
 not precomputed parameters for the modulus length requested.
  </dl></dd>
</dl>
<hr>
<pre>
<a href="packages.html">All Packages</a>  <a href="tree.html">Class Hierarchy</a>  <a href="Package-java.security.interfaces.html">This Package</a>  <a href="java.security.interfaces.DSAKey.html#_top_">Previous</a>  <a href="java.security.interfaces.DSAParams.html#_top_">Next</a>  <a href="AllNames.html">Index</a></pre>
</body>
</html>
