public function acquireTokenWithAsymmetricKey($resource, $credentials)
    {
        $method = Resources::HTTP_POST;
        $headers = [];
        $queryParams = [];
        $postParameters = [];
        $statusCode = Resources::STATUS_OK;

        $postParameters = $this->addPostParameter(
            $postParameters,
            Resources::OAUTH_CLIENT_ASSERTION_TYPE,
            'urn:ietf:params:oauth:client-assertion-type:jwt-bearer'
        );

        $postParameters = $this->addPostParameter(
            $postParameters,
            Resources::OAUTH_RESOURCE,
            $resource
        );

        $postParameters = $this->addPostParameter(
            $postParameters,
            Resources::OAUTH_GRANT_TYPE,
            'client_credentials'
        );

        $postParameters = $this->addPostParameter(
            $postParameters,
            Resources::OAUTH_SCOPE,
            'openid'
        );

        $postParameters = $this->addPostParameter(
            $postParameters,
            Resources::OAUTH_CLIENT_ASSERTION,
            $this->encodeCertificateAsJWT($credentials)
        );

        $response = $this->sendHttp(
            $method,
            $headers,
            $queryParams,
            $postParameters,
            Resources::EMPTY_STRING,
            $statusCode
        );

        $data = $this->dataSerializer->unserialize($response->getBody());

        $accessToken = $data['access_token'];
        $expirationTime = time() + intval($data['expires_in']);
        return new AccessToken($accessToken, $expirationTime);
    }