rlpx / org.apache.tuweni.rlpx / RLPxConnection

RLPxConnection

class RLPxConnection (source)

Connection between 2 peers over the RLPx protocol.

The RLPx protocol creates a exchange of unique secrets during an initial handshake. The peers proceed to communicate using the shared secrets.

This connection allows encrypting and decrypting messages with a remote peer.

Functions

configureAfterHandshake

fun configureAfterHandshake(helloMessage: HelloMessage): Unit

equals

fun equals(other: Any?): Boolean

hashCode

fun hashCode(): Int

isComplementedBy

static fun isComplementedBy(one: RLPxConnection, other: RLPxConnection): Boolean

Checks if two RLPx connections represent both ends of a connection.

Used for testing.

peerPublicKey

fun peerPublicKey(): PublicKey

publicKey

fun publicKey(): PublicKey

readFrame

fun readFrame(messageFrame: Bytes): RLPxMessage

stream

fun stream(newBytes: Bytes, messageConsumer: Consumer<RLPxMessage>): Unit

write

fun write(message: RLPxMessage): Bytes

Frames a message for sending to an RLPx peer, encrypting it and calculating the appropriate MACs.