KeyFactory keyFac = KeyFactory.getInstance ("DH", "IBMJCE");
//Use server's public key to initiate a DHPublicKeySpec and then use
//this DHPublicKeySpec to initiate a publicKey object
BigInteger publicKey = new BigInteger (1, sourcePublicKey);
DHPublicKeySpec dhKeySpec = new DHPublicKeySpec (publicKey, modulus__, base__);
PublicKey pubKey = keyFac.generatePublic (dhKeySpec);
//Execute the first phase of DH keyagreement protocal.
keyAgreement_.doPhase (pubKey, true);