src/includes/classes/Core/OAuth/Server/Entities/AccessTokenEntity.php
public function convertToJWT(CryptKey $CryptKey)
    {
        return (new Builder())
            ->setAudience($this->getClient()->getIdentifier())
            ->setId($this->getIdentifier(), true)
            ->setIssuedAt(time())
            ->setNotBefore(time())
            ->setExpiration($this->getExpiryDateTime()->getTimestamp())
            ->setSubject($this->getUserIdentifier())
            ->set('scopes', $this->getScopes())
            ->sign(new Sha256(), new Key($CryptKey->getKeyPath(), $CryptKey->getPassPhrase()))
            ->getToken();
    }
public function convertToJWT(CryptKey $CryptKey)
    {
        return (new Builder())
            ->setAudience($this->getClient()->getIdentifier())
            ->setId($this->getIdentifier(), true)
            ->setIssuedAt(time())
            ->setNotBefore(time())
            ->setExpiration($this->getExpiryDateTime()->getTimestamp())
            ->setSubject($this->getUserIdentifier())
            ->set('scopes', $this->getScopes())
            ->sign(new Sha256(), new Key($CryptKey->getKeyPath(), $CryptKey->getPassPhrase()))
            ->getToken();
    }
Convert to JWT (token).

@param CryptKey $CryptKey Private key.

@return string JWT (token).