93 $this->
_init(
'core_config_data',
'config_id');
106 if (!$this->writer->checkIfWritable()) {
107 throw new \Exception(
__(
'Deployment configuration file is not writable.'));
113 $this->encryptor->setNewKey($key);
118 $configData = [$encryptSegment->getFileKey() => $encryptSegment->getData()];
123 $this->_reEncryptSystemConfigurationValues();
128 }
catch (\Exception $e) {
139 protected function _reEncryptSystemConfigurationValues()
144 $paths = $configStructure->getFieldPathsByAttribute(
146 \
Magento\Config\Model\Config\Backend\Encrypted::class
155 ->from(
$table, [
'config_id',
'value'])
156 ->where(
'path IN (?)',
$paths)
157 ->where(
'value NOT LIKE ?',
'')
162 [
'value' => $this->encryptor->encrypt($this->encryptor->decrypt(
$value))],
163 [
'config_id = ?' => (
int)$configId]
184 [
'cc_number_enc' => $this->encryptor->encrypt($this->encryptor->decrypt(
$value))],
185 [
'entity_id = ?' => (
int)$valueId]
const STORE_KEY_RANDOM_STRING_SIZE
_reEncryptCreditCardNumbers()
const CONFIG_PATH_CRYPT_KEY
_init($mainTable, $idFieldName)
__construct(\Magento\Framework\Model\ResourceModel\Db\Context $context, \Magento\Framework\Filesystem $filesystem, \Magento\Config\Model\Config\Structure $structure, \Magento\Framework\Encryption\EncryptorInterface $encryptor, \Magento\Framework\App\DeploymentConfig\Writer $writer, \Magento\Framework\Math\Random $random, $connectionName=null)
changeEncryptionKey($key=null)