class JWT::JWK::KeyBase
Base for JWK
implementations
Attributes
Public Class Methods
Source
# File lib/jwt/jwk/key_base.rb, line 7 def self.inherited(klass) super ::JWT::JWK.classes << klass end
Calls superclass method
Source
# File lib/jwt/jwk/key_base.rb, line 12 def initialize(options, params = {}) options ||= {} @parameters = params.transform_keys(&:to_sym) # Uniform interface # For backwards compatibility, kid_generator may be specified in the parameters options[:kid_generator] ||= @parameters.delete(:kid_generator) # Make sure the key has a kid kid_generator = options[:kid_generator] || ::JWT.configuration.jwk.kid_generator self[:kid] ||= kid_generator.new(self).generate end
Public Instance Methods
Source
# File lib/jwt/jwk/key_base.rb, line 47 def <=>(other) return nil unless other.is_a?(::JWT::JWK::KeyBase) self[:kid] <=> other[:kid] end
Source
# File lib/jwt/jwk/key_base.rb, line 41 def ==(other) other.is_a?(::JWT::JWK::KeyBase) && self[:kid] == other[:kid] end
Also aliased as: eql?
Source
# File lib/jwt/jwk/key_base.rb, line 37 def []=(key, value) @parameters[key.to_sym] = value end