jwt / ruby-jwe

JSON Web Encryption for Ruby
MIT License
65 stars 14 forks source link

Algorithm class names don't match param_to_class_name output #19

Closed lizGraham9CB closed 5 years ago

lizGraham9CB commented 5 years ago

Several of the class names under JWE::Alg aren't cased correctly to match the output from JWE.param_to_class_name. This mismatch means that perfectly valid algs throw a NotImplementedError.

For example: With JWE.encrypt(jwt, secret, alg: 'A256KW'), JWE.param_to_class_name converts the alg to "A256kw". Then const_get looks for a matching class name, but doesn't find one because the class is A256Kw.

This should be a real quick fix.

lizGraham9CB commented 5 years ago

Oh, just realized there's a PR to fix this. Gonna leave the issue open until the PR gets merged. https://github.com/jwt/ruby-jwe/pull/18