/** * Writes the SerializedPublicKeyLength of the RSAClientKeyExchangeMessage * into the final byte[] */ private void writeSerializedPublicKeyLength(T msg) { appendInt(msg.getPublicKeyLength().getValue(), HandshakeByteLength.ENCRYPTED_PREMASTER_SECRET_LENGTH); LOGGER.debug("SerializedPublicKeyLength: " + msg.getPublicKeyLength().getValue()); }
protected void prepareSerializedPublicKeyLength(T msg) { msg.setPublicKeyLength(msg.getPublicKey().getValue().length); LOGGER.debug("SerializedPublicKeyLength: " + msg.getPublicKeyLength().getValue()); }
/** * Reads the next bytes as the SerializedPublicKey and writes them in the * message * * @param msg * Message to write in */ private void parseSerializedPublicKey(T msg) { msg.setPublicKey(parseByteArrayField(msg.getPublicKeyLength().getValue())); LOGGER.debug("SerializedPublicKey: " + ArrayConverter.bytesToHexString(msg.getPublicKey().getValue())); }
/** * Reads the next bytes as the SerializedPublicKeyLength and writes them in * the message * * @param msg * Message to write in */ private void parseSerializedPublicKeyLength(T msg) { if (getVersion().isSSL()) { msg.setPublicKeyLength(getBytesLeft()); } else { msg.setPublicKeyLength(parseIntField(HandshakeByteLength.ENCRYPTED_PREMASTER_SECRET_LENGTH)); } LOGGER.debug("SerializedPublicKeyLength: " + msg.getPublicKeyLength().getValue()); }