public AuthData(RpcAuthenticationType type, RpcAuthenticationLevel level, int padding, int context_id, byte[] data)
 {
     Type      = type;
     Level     = level;
     Padding   = padding;
     ContextId = context_id;
     Data      = data;
 }
        public static AuthData Read(BinaryReader reader, int auth_length)
        {
            RpcAuthenticationType  type  = (RpcAuthenticationType)reader.ReadByte();
            RpcAuthenticationLevel level = (RpcAuthenticationLevel)reader.ReadByte();
            int padding = reader.ReadByte();

            reader.ReadByte(); // Reserved;
            int context_id = reader.ReadInt32();

            return(new AuthData(type, level, padding, context_id, reader.ReadAllBytes(auth_length)));
        }