/**
* @inheritdoc
*/
public function load($id)
{
if (!is_file($id)) {
throw new \Exception(sprintf('Could not find "%s"', $id));
}
if (!is_readable($id)) {
throw new \Exception(sprintf('"%s" cannot be read, check permissions', $id));
}
$encoded = file_get_contents($id);
$decoded = openssl_decrypt(\Bitpay\Util\Util::binConv($encoded), self::METHOD, $this->password, 1, self::IV);
if (false === $decoded) {
throw new \Exception('Could not decode key');
}
return unserialize($decoded);
}