public function authenticateResponseWithSharedKey(
        ResponseInterface $response,
        SharedAuthenticationKey $key
    ): ResponseInterface {
        $mac = \ParagonIE_Sodium_Compat::crypto_auth(
            (string) $response->getBody(),
            $key->getString(true)
        );
        return $response->withAddedHeader(
            self::HEADER_AUTH_NAME,
            Base64UrlSafe::encode($mac)
        );
    }