<?php

namespace App\Utils\CreditCard\Encryption;

class LocalCodeKey extends GeneralAbstract
{

	/**
	 * Load key from code.
	 * @see \App\Utils\CreditCard\Encryption\GeneralAbstract::setKey()
	 */
	protected function setKey() : void
	{

		$CFG = \Engine\Loader_Cfg::getInstance()->getGlobal();

		if (!$CFG['pciDss']['localCodeKey']) {
			throw new \Exception('Local code key must be configured in order to encrypt CC number.');
		}

		$this->key = $CFG['pciDss']['localCodeKey'];
	}

}

