class Google::Auth::IDTokens::X509CertHttpKeySource


Used by the legacy OAuth V1 public certs endpoint.
A key source that downloads X509 certificates.
#

def initialize uri, algorithm: "RS256", retry_interval: nil

Parameters:
  • retry_interval (Integer, nil) -- Override the retry interval in
  • algorithm (String) -- The algorithm to use for signature
  • uri (String, URI) -- The URI from which to download keys.
def initialize uri, algorithm: "RS256", retry_interval: nil
  super uri, retry_interval: retry_interval
  @algorithm = algorithm
end

def interpret_json data

def interpret_json data
  data.map do |id, cert_str|
    key = OpenSSL::X509::Certificate.new(cert_str).public_key
    KeyInfo.new id: id, key: key, algorithm: @algorithm
  end
rescue OpenSSL::X509::CertificateError
  raise KeySourceError, "Unable to parse X509 certificates"
end