Class: LightJWT::JWT
- Inherits:
-
Object
- Object
- LightJWT::JWT
- Defined in:
- lib/light_jwt/jwt.rb
Instance Attribute Summary collapse
-
#claims ⇒ Object
Returns the value of attribute claims.
Class Method Summary collapse
Instance Method Summary collapse
- #encrypt(alg, enc, public_key) ⇒ Object
-
#initialize(claims = {}) ⇒ JWT
constructor
A new instance of JWT.
- #sign(alg, signing_key) ⇒ Object
Constructor Details
#initialize(claims = {}) ⇒ JWT
Returns a new instance of JWT.
39 40 41 |
# File 'lib/light_jwt/jwt.rb', line 39 def initialize(claims = {}) @claims = claims end |
Instance Attribute Details
#claims ⇒ Object
Returns the value of attribute claims.
5 6 7 |
# File 'lib/light_jwt/jwt.rb', line 5 def claims @claims end |
Class Method Details
.decode(input, key_or_options = {}) ⇒ Object
8 9 10 11 12 |
# File 'lib/light_jwt/jwt.rb', line 8 def decode(input, = {}) key, = () handler = handler_for(input) handler.decode(input, key, ) end |
Instance Method Details
#encrypt(alg, enc, public_key) ⇒ Object
47 48 49 |
# File 'lib/light_jwt/jwt.rb', line 47 def encrypt(alg, enc, public_key) JWEHandler.new.encrypt(claims, alg, enc, public_key) end |
#sign(alg, signing_key) ⇒ Object
43 44 45 |
# File 'lib/light_jwt/jwt.rb', line 43 def sign(alg, signing_key) JWSHandler.new.sign(claims, alg, signing_key) end |