package com.jscape.inet.ssh.protocol.v2.messages;

import com.jscape.inet.ssh.protocol.messages.Message;
import com.jscape.util.net.connection.MessageConnection;

import java.security.PublicKey;

import static com.jscape.util.Parameters.assertNotNull;

/**
 * @author Alex Uzun
 */
public class SshMsgKexEcdhInit
        extends Message<SshMsgKexEcdhInit.Handler> {

    public final PublicKey qc;

    public SshMsgKexEcdhInit(PublicKey qc) {
        assertNotNull(qc);
        this.qc = qc;
    }

    @Override
    public Class handlerClass() {
        return Handler.class;
    }

    @Override
    public void accept(Handler handler, MessageConnection<Message> connection) {
        handler.handle(this, connection);
    }

    @Override
    public String toString() {
        return "SshMsgKexEcdhInit {"
               + "qc=" + this.qc
               + '}';
    }

    public interface Handler
            extends Message.HandlerBase {

        void handle(SshMsgKexEcdhInit message, MessageConnection<Message> connection);

    }
}
