public KeyPair generateKeyPair(){
  if (random == null) {
    random=JCAUtil.getSecureRandom();
  }
  DSAParameterSpec spec;
  try {
    if (forceNewParameters) {
      spec=ParameterCache.getNewDSAParameterSpec(plen,qlen,random);
    }
 else {
      if (params == null) {
        params=ParameterCache.getDSAParameterSpec(plen,qlen,random);
      }
      spec=params;
    }
  }
 catch (  GeneralSecurityException e) {
    throw new ProviderException(e);
  }
  return generateKeyPair(spec.getP(),spec.getQ(),spec.getG(),random);
}

public KeyPair generateKeyPair ( ) { if ( random == null ) { random = JCAUtil . getSecureRandom ( ) ; } DSAParameterSpec spec ; try { if ( forceNewParameters ) { spec = ParameterCache . getNewDSAParameterSpec ( plen , qlen , random ) ; } else { if ( params == null ) { params = ParameterCache . getDSAParameterSpec ( plen , qlen , random ) ; } spec = params ; } } catch ( GeneralSecurityException e ) { throw new ProviderException ( e ) ; } return generateKeyPair ( spec . getP ( ) , spec . getQ ( ) , spec . getG ( ) , random ) ; }
generates a pair of keys usable by any javasecurity compliant dsa implementation .
