getSignedJSON() public method

Internally verifies an Ed25519 signature.
public getSignedJSON ( string $url, SignaturePublicKey $publicKey, array $params = [] ) : mixed
$url string
$publicKey SignaturePublicKey
$params array
return mixed
Ejemplo n.º 1
0
 /**
  * Fetch all of the updates from the remote server.
  *
  * @param Channel $chan
  * @param string $url
  * @param string $root Which Merkle root are we starting at?
  * @return TreeUpdate[]
  */
 protected function fetchTreeUpdates(Channel $chan, string $url, string $root) : array
 {
     try {
         return $this->parseTreeUpdateResponse($chan, $this->hail->getSignedJSON($url . API::get('fetch_keys') . '/' . $root, $chan->getPublicKey()));
     } catch (SignatureFailed $ex) {
         $state = State::instance();
         if (IDE_HACKS) {
             $state->logger = new Ledger();
         }
         $state->logger->alert('Signature failed!', \Airship\throwableToArray($ex));
     }
     return [];
 }