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 for signature verification. RSA and Elliptical Curve (EC) keys are supported.
Inherits
- Object
Methods
.from_jwk
def self.from_jwk(jwk) -> KeyInfo
Create a KeyInfo from a single JWK, which may be given as either a hash or an unparsed JSON string.
- jwk (Hash, String) — The JWK specification.
- (KeyInfo)
- (KeySourceError) — If the key could not be extracted from the JWK.
.from_jwk_set
def self.from_jwk_set(jwk_set) -> Array<KeyInfo>
Create an array of KeyInfo from a JWK Set, which may be given as either a hash or an unparsed JSON string.
- jwk (Hash, String) — The JWK Set specification.
- (Array<KeyInfo>)
- (KeySourceError) — If a key could not be extracted from the JWK Set.
#algorithm
def algorithm() -> String
The signature algorithm. (normally RS256
or ES256
)
- (String)
#id
def id() -> String
The key ID.
- (String)
#initialize
def initialize(id: nil, key: nil, algorithm: nil) -> KeyInfo
Create a public key info structure.
- 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 (normally
RS256
orES256
)
- (KeyInfo) — a new instance of KeyInfo
#key
def key() -> OpenSSL::PKey::RSA, OpenSSL::PKey::EC
The key itself.
- (OpenSSL::PKey::RSA, OpenSSL::PKey::EC)