protected function revokeKey(Channel $chan, TreeUpdate $update)
{
$supplier = $update->getSupplier();
$name = $supplier->getName();
$file = ROOT . '/config/supplier_keys/' . $name . '.json';
$supplierData = \Airship\loadJSON($file);
foreach ($supplierData['signing_keys'] as $id => $skey) {
if (\hash_equals($skey['public_key'], $update->getPublicKeyString())) {
// Remove this key
unset($supplierData['signing_keys'][$id]);
break;
}
}
\Airship\saveJSON($file, $supplierData);
\clearstatcache();
// Flush the channel's supplier cache
$chan->getSupplier($name, true);
}