Necessary and sufficient conditions for optimal control of semilinear stochastic partial differential equations | Synapse