Airship\Engine\Keyggdrasil::insertKey PHP Method

insertKey() protected method

We're storing a new public key for this supplier.
protected insertKey ( Channel $chan, TreeUpdate $update )
$chan Channel
$update TreeUpdate
    protected function insertKey(Channel $chan, TreeUpdate $update)
    {
        $supplier = $update->getSupplier();
        $name = $supplier->getName();
        $file = ROOT . '/config/supplier_keys/' . $name . '.json';
        $supplierData = \Airship\loadJSON($file);
        $supplierData['signing_keys'][] = ['type' => $update->getKeyType(), 'public_key' => $update->getPublicKeyString()];
        \Airship\saveJSON($file, $supplierData);
        \clearstatcache();
        // Flush the channel's supplier cache
        $chan->getSupplier($name, true);
    }