@Test public void testPrepare() { context.setSelectedCipherSuite(CipherSuite.TLS_RSA_WITH_AES_128_CBC_SHA256); context.setHighestClientProtocolVersion(ProtocolVersion.TLS12); context.setSelectedProtocolVersion(ProtocolVersion.TLS12); context.setClientRandom(ArrayConverter.hexStringToByteArray("AABBCCDDEEFF")); context.setServerRandom(ArrayConverter.hexStringToByteArray("AABBCCDDEEFF")); preparator.prepareHandshakeMessageContents(); assertArrayEquals( ArrayConverter.concatenate(ArrayConverter.hexStringToByteArray("AABBCCDDEEFF"), ArrayConverter.hexStringToByteArray("AABBCCDDEEFF")), message.getComputations() .getClientServerRandom().getValue()); assertNotNull(message.getComputations().getPremasterSecret().getValue()); assertEquals(HandshakeByteLength.PREMASTER_SECRET, message.getComputations().getPremasterSecret().getValue().length); assertEquals(ProtocolVersion.TLS12.getMajor(), message.getComputations().getPremasterSecret().getValue()[0]); assertEquals(ProtocolVersion.TLS12.getMinor(), message.getComputations().getPremasterSecret().getValue()[1]); assertNotNull(message.getComputations().getPlainPaddedPremasterSecret().getValue()); assertEquals((byte) 0x00, message.getComputations().getPlainPaddedPremasterSecret().getValue()[0]); assertEquals((byte) 0x02, message.getComputations().getPlainPaddedPremasterSecret().getValue()[1]); assertEquals((byte) 0x00, message.getComputations().getPlainPaddedPremasterSecret().getValue()[message .getComputations().getPadding().getValue().length + 2]); assertNotNull(message.getPublicKeyLength().getValue()); assertNotNull(message.getPublicKey()); }
@Override public void prepareHandshakeMessageContents() { LOGGER.debug("Preparing RSAClientKeyExchangeMessage"); prepareAfterParse(true); prepareSerializedPublicKey(msg); prepareSerializedPublicKeyLength(msg); }
RSAClientKeyExchangePreparator extends
        ClientKeyExchangePreparator<T> { @Override public void prepareHandshakeMessageContents() { LOGGER.debug("Preparing RSAClientKeyExchangeMessage"); prepareAfterParse(true); prepareSerializedPublicKey(msg); prepareSerializedPublicKeyLength(msg); } }
RSAClientKeyExchangePreparator extends
        ClientKeyExchangePreparator<T> { @Override public void prepareHandshakeMessageContents() { LOGGER.debug("Preparing RSAClientKeyExchangeMessage"); prepareAfterParse(true); prepareSerializedPublicKey(msg); prepareSerializedPublicKeyLength(msg); } RSAClientKeyExchangePreparator(Chooser chooser, T message); }
RSAClientKeyExchangePreparator extends
        ClientKeyExchangePreparator<T> { @Override public void prepareHandshakeMessageContents() { LOGGER.debug("Preparing RSAClientKeyExchangeMessage"); prepareAfterParse(true); prepareSerializedPublicKey(msg); prepareSerializedPublicKeyLength(msg); } RSAClientKeyExchangePreparator(Chooser chooser, T message); @Override void prepareHandshakeMessageContents(); @Override void prepareAfterParse(boolean clientMode); }
RSAClientKeyExchangePreparator extends
        ClientKeyExchangePreparator<T> { @Override public void prepareHandshakeMessageContents() { LOGGER.debug("Preparing RSAClientKeyExchangeMessage"); prepareAfterParse(true); prepareSerializedPublicKey(msg); prepareSerializedPublicKeyLength(msg); } RSAClientKeyExchangePreparator(Chooser chooser, T message); @Override void prepareHandshakeMessageContents(); @Override void prepareAfterParse(boolean clientMode);  }