class Auth0RS256JWTVerifier::JWK

Constants

Alg
E
Kid
Kty
N
ParseError
Use
X5T

Attributes

alg[R]
e[R]
kid[R]
kty[R]
n[R]
use[R]
x5c[R]
x5t[R]

Public Class Methods

new(hash) click to toggle source
# File lib/auth0_rs256_jwt_verifier/jwk.rb, line 6
def initialize(hash)
  raise ParseError unless hash.is_a?(Hash)
  %i(Alg Kty Use X5C N E Kid X5T).each do |field_name|
    field = self.class.const_get(field_name).new(hash[String(field_name).downcase])
    instance_variable_set("@#{String(field_name).downcase}", field)
  end
end

Public Instance Methods

inspect() click to toggle source
# File lib/auth0_rs256_jwt_verifier/jwk.rb, line 16
def inspect
  "JWK(\n"                    \
  "\talg: #{@alg},\n"         \
  "\tkty: #{@kty},\n"         \
  "\tuse: #{@use},\n"         \
  "\tx5c: #{@x5c.inspect.split("\n").map { |l| "\t#{l}" }.join("\n")},\n" \
  "\tn: #{@n},\n"             \
  "\te: #{@e},\n"             \
  "\tkid: #{@kid},\n"         \
  "\tx5t: #{@x5t}\n"          \
  ")"
end