googleauth - Class Google::Auth::IDTokens::KeyInfo (v1.12.2)

Reference documentation and code samples for the googleauth class Google::Auth::IDTokens::KeyInfo.

A public key used for verifying ID tokens.

This includes the public key data, ID, and the algorithm used forsignature verification. RSA and Elliptical Curve (EC) keys aresupported.

Inherits

  • Object

Methods

.from_jwk

defself.from_jwk(jwk)->KeyInfo

Create a KeyInfo from a single JWK, which may be given as either ahash or an unparsed JSON string.

Parameter
  • jwk (Hash, String) — The JWK specification.
Raises

.from_jwk_set

defself.from_jwk_set(jwk_set)->Array<KeyInfo>

Create an array of KeyInfo from a JWK Set, which may be given aseither a hash or an unparsed JSON string.

Parameter
  • jwk (Hash, String) — The JWK Set specification.
Returns
Raises
  • (KeySourceError) — If a key could not be extracted from theJWK Set.

#algorithm

defalgorithm()->String

The signature algorithm. (normallyRS256 orES256)

Returns
  • (String)

#id

defid()->String

The key ID.

Returns
  • (String)

#initialize

definitialize(id:nil,key:nil,algorithm:nil)->KeyInfo

Create a public key info structure.

Parameters
  • id (String)(defaults to: nil) — The key ID.
  • key (OpenSSL::PKey::RSA, OpenSSL::PKey::EC)(defaults to: nil) — The key itself.
  • algorithm (String)(defaults to: nil) — The algorithm (normallyRS256 orES256)
Returns
  • (KeyInfo) — a new instance of KeyInfo

#key

defkey()->OpenSSL::PKey::RSA,OpenSSL::PKey::EC

The key itself.

Returns
  • (OpenSSL::PKey::RSA, OpenSSL::PKey::EC)

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-10-30 UTC.