code: public final Key doPhase(Key key, boolean lastPhase)
          throws InvalidKeyException, IllegalStateException
      {
          chooseFirstProvider();
          return spi.engineDoPhase(key, lastPhase);
      }
docs: Executes the next phase of this key agreement with the given
  key that was received from one of the other parties involved in this key
  agreement.
  
  @param key the key for this phase. For example, in the case of
  Diffie-Hellman between 2 parties, this would be the other party's
  Diffie-Hellman public key.
  @param lastPhase flag which indicates whether or not this is the last
  phase of this key agreement.
  
  @return the (intermediate) key resulting from this phase, or null
  if this phase does not yield a key
  
  @exception InvalidKeyException if the given key is inappropriate for
  this phase.
  @exception IllegalStateException if this key agreement has not been
  initialized.