public boolean trustConnection(String nonce) {
        if (this.listener.shouldIgnoreMessages()) {
            return false;
        }

        if (this.remotePublicKey != null) {
            return false;
        }

        PublicKey publicKey = this.listener.helloHandler().getAttemptedConnection(nonce);
        if (publicKey == null) {
            return false;
        }

        this.remotePublicKey = publicKey;

        // save the key in the keystore
        this.plugin.getWebEditorStore().keystore().trust(this.sender, this.remotePublicKey.getEncoded());

        // send a reply back to the editor to say that it is now trusted
        send(SocketMessageType.HELLO_REPLY.builder()
                .add("nonce", nonce)
                .add("state", "trusted")
                .toJson()
        );
        return true;
    }
Send a message to the socket.

<p>The message will be encoded as JSON and
signed using the public public key.</p>

@param msg the message
common/src/main/java/me/lucko/luckperms/common/webeditor/socket/WebEditorSocket.java