public class TestDhKeyGenerator extends TestCase {
public void testKeyGenerationDefault() throws CryptoException {
DhKeyGenerator keyGenServer = new DhKeyGenerator();
DhKeyGenerator keyGenClient = new DhKeyGenerator();
byte[] serverKey = keyGenServer.createPublicKey();
byte[] clientKey = keyGenClient.createPublicKey();
SymmetricCryptor serverCryptor = keyGenServer.getSymmetricCryptor(clientKey);
SymmetricCryptor clientCryptor = keyGenClient.getSymmetricCryptor(serverKey);
String cleartext = "cleartext!"; //$NON-NLS-1$
String ciphertext = serverCryptor.encrypt(cleartext);
String cleartext2 = clientCryptor.decrypt(ciphertext);