#pragma once #include #include enum class ExMsgType : quint8 { ident = 1, auth_request = 2, auth_challenge = 3, auth_response = 4 }; struct ExMessage { ExMsgType type; QByteArray body; }; enum class AuthMethod { certificate = 1, password = 2, }; struct Ident { quint8 version; }; struct AuthRequest { QString username; AuthMethod method; // Will be replaced if passwords are implemented. QByteArray credentials; }; struct AuthChallenge { QByteArray challenge; }; struct AuthResponse { QByteArray response; }; QByteArray serializeIdent(const Ident &m); QByteArray serializeAuthRequest(const AuthRequest &m); QByteArray serializeAuthResponse(const AuthResponse &m); bool parseAuthChallenge(QByteArrayView in, AuthChallenge &out);