private function getUserPasswordDigest(PKEncryptionEnabledUserInterface $user)
    {
        $passwordDigest = $user->getPasswordDigest();

        if (!$passwordDigest) {
            $password = $user->getPlainPassword();

            if ($password) {
                $salt = $user->getSalt();
                $passwordDigest = $this->cryptographyProvider->getPasswordDigest($password, $salt);
            }
        }

        return $passwordDigest;
    }