Motivated by applications in subsurface CO2 sequestration, we investigate constrained optimal control problems with partially miscible two-phase flow in porous media. The objective is, e.g., to maximize the amount of trapped CO2 in an underground reservoir after a fixed period of CO2 injection, where the time-dependent injection rates in multiple wells are used as control parameters. We describe the governing two-phase two-component Darcy flow PDE system and formulate the optimal control problem. For the discretization we use a variant of the BOX method, a locally conservative control-volume FE method. The timestep-wise Lagrangian of the control problem is implemented as a functional in the PDE toolbox Sundance, which is part of the HPC software Trilinos. The resulting MPI parallelized Sundance state and adjoint solvers are linked to the interior point optimization package IPOPT. Finally, we present some numerical results in a heterogeneous model reservoir.