code: public final void init(AlgorithmParameterSpec params, SecureRandom random)
          throws InvalidAlgorithmParameterException
      {
          if (serviceIterator == null) {
              spi.engineInit(params, random);
              return;
          }
          Exception failure = null;
          KeyGeneratorSpi mySpi = spi;
          do {
              try {
                  mySpi.engineInit(params, random);
                  initType = I_PARAMS;
                  initKeySize = 0;
                  initParams = params;
                  initRandom = random;
                  return;
              } catch (Exception e) {
                  if (failure == null) {
                      failure = e;
                  }
                  mySpi = nextSpi(mySpi, false);
              }
          } while (mySpi != null);
          if (failure instanceof InvalidAlgorithmParameterException) {
              throw (InvalidAlgorithmParameterException)failure;
          }
          if (failure instanceof RuntimeException) {
              throw (RuntimeException)failure;
          }
          throw new InvalidAlgorithmParameterException("init() failed", failure);
      }
docs: Initializes this key generator with the specified parameter
  set and a user-provided source of randomness.
  
  @param params the key generation parameters
  @param random the source of randomness for this key generator
  
  @exception InvalidAlgorithmParameterException if <code>params</code> is
  inappropriate for this key generator