Yoast\WP\SEO\MyYoast_Client\Infrastructure\OIDC

ID_Token_Validator::get_public_keyprivateYoast 1.0

Fetches the public key from JWKS for the given kid.

Метод класса: ID_Token_Validator{}

Хуков нет.

Возвращает

Строку|null. The 32-byte Ed25519 public key, or null if not found.

Использование

// private - только в коде основоного (родительского) класса
$result = $this->get_public_key( $kid ): ?string;
$kid(строка) (обязательный)
The key ID to find.

Код ID_Token_Validator::get_public_key() Yoast 27.7

private function get_public_key( string $kid ): ?string {
	$jwks = $this->fetch_jwks();
	$key  = ( $jwks !== null ) ? $this->find_ed25519_key( $jwks, $kid ) : null;
	if ( $key !== null ) {
		return $key;
	}

	// Kid not found in cache — try refreshing JWKS.
	$this->logger->debug( 'Key kid={kid} not found in cached JWKS, refreshing.', [ 'kid' => $kid ] );
	\delete_transient( $this->get_jwks_transient_key() );
	$jwks = $this->fetch_jwks();

	return ( $jwks !== null ) ? $this->find_ed25519_key( $jwks, $kid ) : null;
}