Application of convex analysis to the treatment of elastoplastic systems