Class: JSONWebToken::RSAToken
- Defined in:
- lib/json_web_token/rsa_token.rb
Constant Summary
Constants inherited from Token
Token::DEFAULT_EXPIRE_TIME, Token::DEFAULT_NOT_BEFORE_TIME
Instance Attribute Summary collapse
-
#key_file ⇒ Object
readonly
Returns the value of attribute key_file.
Attributes inherited from Token
#audience, #expire_time, #id, #issued_at, #issuer, #not_before, #subject
Instance Method Summary collapse
- #encoded ⇒ Object
-
#initialize(key_file) ⇒ RSAToken
constructor
A new instance of RSAToken.
Methods inherited from Token
Constructor Details
#initialize(key_file) ⇒ RSAToken
Returns a new instance of RSAToken.
7 8 9 10 |
# File 'lib/json_web_token/rsa_token.rb', line 7 def initialize(key_file) super() @key_file = key_file end |
Instance Attribute Details
#key_file ⇒ Object (readonly)
Returns the value of attribute key_file.
5 6 7 |
# File 'lib/json_web_token/rsa_token.rb', line 5 def key_file @key_file end |
Instance Method Details
#encoded ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/json_web_token/rsa_token.rb', line 12 def encoded headers = { kid: kid, typ: 'JWT' } JWT.encode(payload, key, 'RS256', headers) end |