module JSON::JOSE

def content_type

def content_type
  @content_type ||= 'application/jose'
end

def header

def header
  @header ||= {}
end

def secure_compare(a, b)

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

def with_jwk_support(key)

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