[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[],[],null,["# googleauth - Class Google::Auth::IDTokens::KeyInfo (v1.15.0)\n\nVersion latestkeyboard_arrow_down\n\n- [1.15.0 (latest)](/ruby/docs/reference/googleauth/latest/Google-Auth-IDTokens-KeyInfo)\n- [1.14.0](/ruby/docs/reference/googleauth/1.14.0/Google-Auth-IDTokens-KeyInfo)\n- [1.13.1](/ruby/docs/reference/googleauth/1.13.1/Google-Auth-IDTokens-KeyInfo)\n- [1.12.2](/ruby/docs/reference/googleauth/1.12.2/Google-Auth-IDTokens-KeyInfo) \nReference documentation and code samples for the googleauth class Google::Auth::IDTokens::KeyInfo.\n\nA public key used for verifying ID tokens.\n\n\n\u003cbr /\u003e\n\nThis includes the public key data, ID, and the algorithm used for\nsignature verification. RSA and Elliptical Curve (EC) keys are\nsupported. \n\nInherits\n--------\n\n- Object\n\nMethods\n-------\n\n### .from_jwk\n\n def self.from_jwk(jwk) -\u003e KeyInfo\n\nCreate a KeyInfo from a single JWK, which may be given as either a\nhash or an unparsed JSON string. \n**Parameter**\n\n- **jwk** (Hash, String) --- The JWK specification. \n**Returns**\n\n- ([KeyInfo](./Google-Auth-IDTokens-KeyInfo)) \n**Raises**\n\n- ([Google::Auth::IDTokens::KeySourceError](./Google-Auth-IDTokens-KeySourceError)) --- If the key could not be extracted from the JWK due to invalid type, malformed JSON, or invalid key data.\n\n### .from_jwk_set\n\n def self.from_jwk_set(jwk_set) -\u003e Array\u003cKeyInfo\u003e\n\nCreate an array of KeyInfo from a JWK Set, which may be given as\neither a hash or an unparsed JSON string. \n**Parameter**\n\n- **jwk_set** (Hash, String) --- The JWK Set specification. \n**Returns**\n\n- (Array\\\u003c[KeyInfo](./Google-Auth-IDTokens-KeyInfo)\\\u003e) \n**Raises**\n\n- ([Google::Auth::IDTokens::KeySourceError](./Google-Auth-IDTokens-KeySourceError)) --- If a key could not be extracted from the JWK Set, or if the set contains no keys.\n\n### #algorithm\n\n def algorithm() -\u003e String\n\nThe signature algorithm. (normally `RS256` or `ES256`) \n**Returns**\n\n- (String)\n\n### #id\n\n def id() -\u003e String\n\nThe key ID. \n**Returns**\n\n- (String)\n\n### #initialize\n\n def initialize(id: nil, key: nil, algorithm: nil) -\u003e KeyInfo\n\nCreate a public key info structure. \n**Parameters**\n\n- **id** (String) *(defaults to: nil)* --- The key ID.\n- **key** (OpenSSL::PKey::RSA, OpenSSL::PKey::EC) *(defaults to: nil)* --- The key itself.\n- **algorithm** (String) *(defaults to: nil)* --- The algorithm (normally `RS256` or `ES256`) \n**Returns**\n\n- ([KeyInfo](./Google-Auth-IDTokens-KeyInfo)) --- a new instance of KeyInfo\n\n### #key\n\n def key() -\u003e OpenSSL::PKey::RSA, OpenSSL::PKey::EC\n\nThe key itself. \n**Returns**\n\n- (OpenSSL::PKey::RSA, OpenSSL::PKey::EC)"]]