Airship\Engine\Keyggdrasil::revokeKey PHP Method

revokeKey() protected method

We're storing a new public key for this supplier.
protected revokeKey ( Channel $chan, TreeUpdate $update ) : void
$chan Channel
$update TreeUpdate
return void
    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);
    }