> The declaration of war and your uniform make the homicide legal.

Declarations of war have very little international importance any more, since the recognition of the crime of aggression; either you are engaging in aggressive war, which a declaration does nothing to legitimize, or you are engaging in defensive war against an aggressor, where it is the aggression, not any declaration, that gives your fighting legitimacy.