Neos\Flow\Security\Cryptography\RsaWalletServicePhp::injectSettings PHP Method

injectSettings() public method

Injects the OpenSSL configuration to be used
public injectSettings ( array $settings ) : void
$settings array
return void
    public function injectSettings(array $settings)
    {
        if (isset($settings['security']['cryptography']['RSAWalletServicePHP']['openSSLConfiguration']) && is_array($settings['security']['cryptography']['RSAWalletServicePHP']['openSSLConfiguration'])) {
            $this->openSSLConfiguration = $settings['security']['cryptography']['RSAWalletServicePHP']['openSSLConfiguration'];
        }
        if (isset($settings['security']['cryptography']['RSAWalletServicePHP']['keystorePath'])) {
            $this->keystorePathAndFilename = $settings['security']['cryptography']['RSAWalletServicePHP']['keystorePath'];
        } else {
            throw new MissingConfigurationException('The configuration setting Neos.Flow.security.cryptography.RSAWalletServicePHP.keystorePath is missing. Please specify it in your Settings.yaml file. Beware: This file must not be accessible by the public!', 1305711354);
        }
    }

Usage Example

 /**
  * Set up this testcase.
  * In this case this only marks the test to be skipped if openssl extension is not installed
  *
  * @return void
  */
 public function setUp()
 {
     vfsStream::setup('Foo');
     $settings['security']['cryptography']['RSAWalletServicePHP']['keystorePath'] = 'vfs://Foo/EncryptionKey';
     $this->rsaWalletService = $this->getAccessibleMock(RsaWalletServicePhp::class, ['dummy']);
     $this->rsaWalletService->injectSettings($settings);
     $this->keyPairUuid = $this->rsaWalletService->generateNewKeypair();
 }