Implements a good chunk of the JSON Web Encryption specification.