module JSON::JOSE

Attributes

header[W]

Public Instance Methods

content_type() click to toggle source
# File lib/json/jose.rb, line 19
def content_type
  @content_type ||= 'application/jose'
end
header() click to toggle source
# File lib/json/jose.rb, line 15
def header
  @header ||= {}
end
secure_compare(a, b) click to toggle source
# File lib/json/jose.rb, line 35
def secure_compare(a, b)
  if ActiveSupport::SecurityUtils.respond_to?(:fixed_length_secure_compare)
    begin
      ActiveSupport::SecurityUtils.fixed_length_secure_compare(a, b)
    rescue ArgumentError
      false
    end
  else
    ActiveSupport::SecurityUtils.secure_compare(a, b)
  end
end
with_jwk_support(key) click to toggle source
# File lib/json/jose.rb, line 24
def with_jwk_support(key)
  case key
  when JSON::JWK
    key.to_key
  when JSON::JWK::Set
    key[kid]&.to_key or raise JWK::Set::KidNotFound
  else
    key
  end
end