class Authentication extends PGMessage {

    public static Authentication loadFromPacket(byte[] packet) {
        PGProto proto = new PGProto(packet, 5);
        AuthType authType = AuthType.getAuthType(proto.readInt32());
        switch (authType) {
            case AuthenticationMD5Password:
                return AuthenticationMD5Password.loadFromPacket(packet);
            case AuthenticationOk:
                return AuthenticationOk.loadFromPacket(packet);
            default:
                throw new IllegalArgumentException("not implement auth method " + authType);
        }
    }

    public  Authentication(AuthType authType);

}