This is a self-contained account of the state of the art in classical complex multiplication that includes recent results on rings of integers and applications to cryptography using elliptic curves. The author is exhaustive in his treatment, giving a thorough development of the theory of elliptic functions, modular functions and quadratic number fields and providing a concise summary of the results from class field theory. The main results are accompanied by numerical examples, equipping any reader with all the tools and formulas they need. Topics covered include: the construction of class fields over quadratic imaginary number fields by singular values of the modular invariant j and Weber's tau-function; explicit construction of rings of integers in ray class fields and Galois module structure; the construction of cryptographically relevant elliptic curves over finite fields; proof of Berwick's congruences using division values of the Weierstrass p-function; relations between elliptic units and class numbers.