Abstract
In this paper we provide necessary and sufficient conditions for optimality of a stochastic differential equation driven by an infinite dimensional martingale, and its solution takes its values in a separable Hilbert space. By using the adjoint equation, which is a backward stochastic differential equation, we derive the maximum principle in the sense of Pontryagin for this optimal control problem.