Neos\Flow\Security\Cryptography\FileBasedSimpleKeyService::persistKey PHP Method

persistKey() protected method

Persists a key to the file system
protected persistKey ( string $name, string $password ) : void
$name string
$password string
return void
    protected function persistKey($name, $password)
    {
        $hashedPassword = $this->hashService->hashPassword($password, $this->passwordHashingStrategy);
        $keyPathAndFilename = $this->getKeyPathAndFilename($name);
        if (!is_dir($this->getPath())) {
            Utility\Files::createDirectoryRecursively($this->getPath());
        }
        $result = file_put_contents($keyPathAndFilename, $hashedPassword);
        if ($result === false) {
            throw new SecurityException(sprintf('The key could not be stored ("%s").', $keyPathAndFilename), 1305812921);
        }
    }