class Auth0RS256JWTVerifier::CertsSet
Constants
- CertWithId
- NotFoundError
Public Class Methods
new(jwk_set)
click to toggle source
# File lib/auth0_rs256_jwt_verifier/certs_set.rb, line 7 def initialize(jwk_set) @jwk_set = jwk_set end
Public Instance Methods
find(id)
click to toggle source
# File lib/auth0_rs256_jwt_verifier/certs_set.rb, line 11 def find(id) id = String(id) cert = certs.find { |c| c.id == id } raise NotFoundError, "cert #{id} doesn't exist" if cert.nil? cert.cert end
Private Instance Methods
build_cert(jwk)
click to toggle source
# File lib/auth0_rs256_jwt_verifier/certs_set.rb, line 27 def build_cert(jwk) encoded = Base64.decode64(String(jwk.x5c.first)) OpenSSL::X509::Certificate.new(encoded) end
certs()
click to toggle source
# File lib/auth0_rs256_jwt_verifier/certs_set.rb, line 23 def certs @certs ||= @jwk_set.map { |jwk| CertWithId.new(jwk.kid, build_cert(jwk)) } end