DHClientKeyExchangePreparator extends ClientKeyExchangePreparator<T> { @Override public void prepareAfterParse(boolean clientMode) { msg.prepareComputations(); prepareClientServerRandom(msg); setComputationGenerator(msg); setComputationModulus(msg); setComputationPrivateKey(msg, clientMode); if (clientMode) { clientPublicKey = calculatePublicKey(msg.getComputations().getGenerator().getValue(), msg.getComputations() .getModulus().getValue(), msg.getComputations().getPrivateKey().getValue()); preparePublicKey(msg); } setComputationPublicKey(msg, clientMode); premasterSecret = calculatePremasterSecret(msg.getComputations().getModulus().getValue(), msg.getComputations() .getPrivateKey().getValue(), msg.getComputations().getPublicKey().getValue()); preparePremasterSecret(msg); } DHClientKeyExchangePreparator(Chooser chooser, T msg); @Override void prepareHandshakeMessageContents(); @Override void prepareAfterParse(boolean clientMode);  }
@Test public void testPrepareAfterParse() { message.setPublicKey(context.getChooser().getDhClientPublicKey().toByteArray()); preparator.prepareAfterParse(false); }
@Test public void testPrepareAfterParseReverseMode() { preparator.prepareAfterParse(true); }