class RLPxConnectionFactory
(source)
Factory creating RLPxConnection, either from initiating a handshake or responding to a handshake request.
RLPxConnectionFactory()
Factory creating RLPxConnection, either from initiating a handshake or responding to a handshake request. |
static fun createConnection(initiator: Boolean, initiatorMessage: Bytes, responderMessage: Bytes, ourEphemeralPrivateKey: SecretKey, peerEphemeralPublicKey: PublicKey, initiatorNonce: Bytes32, responderNonce: Bytes32, ourPublicKey: PublicKey, peerPublicKey: PublicKey): RLPxConnection
Creates a RLPxConnection based off the complete handshake exchange. |
|
static fun createHandshake(keyPair: KeyPair, remotePublicKey: PublicKey, initAndResponse: Function<Bytes, AsyncResult<Bytes>>): AsyncResult<RLPxConnection>
Creates a complete interaction to run a handshake with a remote peer. |
|
static fun generateRandomBytes32(): Bytes32
Generates a new random 32 byte array. |
|
static fun init(keyPair: KeyPair, remotePublicKey: PublicKey, ephemeralKeyPair: KeyPair, initiatorNonce: Bytes32): Bytes
Creates a handshake initiation message using ephemeral keys and a random nonce. |
|
static fun messageSize(msgBytes: Bytes): Int
Identify the size of a handshake message based on elements of the common MAC. |
|
static fun readResponse(response: Bytes, privateKey: SecretKey): HandshakeMessage
Decrypts the handshake response using our private key. |
|
static fun respondToHandshake(initiatorMessageBytes: Bytes, keyPair: KeyPair, responseHandler: Consumer<Bytes>): RLPxConnection
Creates a RLPxConnection in response to a handshake initiation message. |