Class TransportIdentityBinding

java.lang.Object
org.cloudburstmc.netty.util.nethernet.TransportIdentityBinding

public final class TransportIdentityBinding extends Object
Ties the Bedrock login chain to the identity that opened the transport.

On RakNet the encryption handshake does this on its own: the session key comes out of an ECDH against the chain's identity key, so only its holder can read what follows. NetherNet runs over DTLS and skips that handshake, which leaves the chain unbound, and a chain is replayable until something binds it. The signalling assertion binds it here, because the peer proved it holds the key the assertion names before the transport was accepted, and that is the same key the chain is signed with.

Checking the two agree is what makes a login chain meaningful rather than merely well formed.

See Also:
  • Method Details

    • mismatch

      public static String mismatch(io.netty.channel.Channel channel, PublicKey identityPublicKey)
      Parameters:
      channel - The channel the login arrived on
      identityPublicKey - The key the login chain is signed with
      Returns:
      Why the login must be rejected, or null when the two agree
    • mismatch

      public static String mismatch(PlayerInfo player, PublicKey identityPublicKey)
      Parameters:
      player - The identity the transport validated, or null if it has none
      identityPublicKey - The key the login chain is signed with
      Returns:
      Why the login must be rejected, or null when the two agree