class Garage::Jwt::Algorithm

Constants

TYPES

github.com/jwt/ruby-jwt#algorithms-and-usage

Public Class Methods

new(type_key) click to toggle source
# File lib/garage/jwt/algorithm.rb, line 56
def initialize(type_key)
  @type_key = type_key
end

Public Instance Methods

need_common_key?() click to toggle source
# File lib/garage/jwt/algorithm.rb, line 34
def need_common_key?
  %i(hs256 hs384 hs512).include?(@type_key)
end
need_private_key?() click to toggle source
# File lib/garage/jwt/algorithm.rb, line 42
def need_private_key?
  need_public_key?
end
need_public_key?() click to toggle source
# File lib/garage/jwt/algorithm.rb, line 38
def need_public_key?
  %i(rs256 rs384 rs512 es256 es384 es512).include?(@type_key)
end
none?() click to toggle source
# File lib/garage/jwt/algorithm.rb, line 46
def none?
  @type_key == :none
end
type() click to toggle source
# File lib/garage/jwt/algorithm.rb, line 50
def type
  TYPES[@type_key]
end