Class: Auth0RS256JWTVerifier::JWK
- Inherits:
-
Object
- Object
- Auth0RS256JWTVerifier::JWK
- Defined in:
- lib/auth0_rs256_jwt_verifier/jwk.rb
Defined Under Namespace
Constant Summary collapse
- ParseError =
Class.new(RuntimeError)
- Kty =
Class.new(RequiredStringJWKMember)
- Use =
Class.new(OptionalStringJWKMember)
- Alg =
Class.new(OptionalStringJWKMember)
- N =
Class.new(OptionalStringJWKMember)
- E =
Class.new(OptionalStringJWKMember)
- Kid =
Class.new(OptionalStringJWKMember)
- X5T =
Class.new(OptionalStringJWKMember)
Instance Attribute Summary collapse
-
#alg ⇒ Object
readonly
Returns the value of attribute alg.
-
#e ⇒ Object
readonly
Returns the value of attribute e.
-
#kid ⇒ Object
readonly
Returns the value of attribute kid.
-
#kty ⇒ Object
readonly
Returns the value of attribute kty.
-
#n ⇒ Object
readonly
Returns the value of attribute n.
-
#use ⇒ Object
readonly
Returns the value of attribute use.
-
#x5c ⇒ Object
readonly
Returns the value of attribute x5c.
-
#x5t ⇒ Object
readonly
Returns the value of attribute x5t.
Instance Method Summary collapse
-
#initialize(hash) ⇒ JWK
constructor
A new instance of JWK.
- #inspect ⇒ Object
Constructor Details
#initialize(hash) ⇒ JWK
Returns a new instance of JWK.
128 129 130 131 132 133 134 |
# File 'lib/auth0_rs256_jwt_verifier/jwk.rb', line 128 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 |
Instance Attribute Details
#alg ⇒ Object (readonly)
Returns the value of attribute alg.
136 137 138 |
# File 'lib/auth0_rs256_jwt_verifier/jwk.rb', line 136 def alg @alg end |
#e ⇒ Object (readonly)
Returns the value of attribute e.
136 137 138 |
# File 'lib/auth0_rs256_jwt_verifier/jwk.rb', line 136 def e @e end |
#kid ⇒ Object (readonly)
Returns the value of attribute kid.
136 137 138 |
# File 'lib/auth0_rs256_jwt_verifier/jwk.rb', line 136 def kid @kid end |
#kty ⇒ Object (readonly)
Returns the value of attribute kty.
136 137 138 |
# File 'lib/auth0_rs256_jwt_verifier/jwk.rb', line 136 def kty @kty end |
#n ⇒ Object (readonly)
Returns the value of attribute n.
136 137 138 |
# File 'lib/auth0_rs256_jwt_verifier/jwk.rb', line 136 def n @n end |
#use ⇒ Object (readonly)
Returns the value of attribute use.
136 137 138 |
# File 'lib/auth0_rs256_jwt_verifier/jwk.rb', line 136 def use @use end |
#x5c ⇒ Object (readonly)
Returns the value of attribute x5c.
136 137 138 |
# File 'lib/auth0_rs256_jwt_verifier/jwk.rb', line 136 def x5c @x5c end |
#x5t ⇒ Object (readonly)
Returns the value of attribute x5t.
136 137 138 |
# File 'lib/auth0_rs256_jwt_verifier/jwk.rb', line 136 def x5t @x5t end |
Instance Method Details
#inspect ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/auth0_rs256_jwt_verifier/jwk.rb', line 6 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 |