public function isValidWardenToken($encryptedRemoteToken, $timestamp) {
    $envelope = json_decode(base64_decode($encryptedRemoteToken));

    if (!is_object($envelope) || empty($envelope->time) || empty($envelope->signature)) {
      return FALSE;
    }

    $remoteTimestamp = base64_decode($envelope->time);

    if (!is_numeric($remoteTimestamp)
      || ($remoteTimestamp > $timestamp + 20)
      || ($remoteTimestamp < $timestamp - 20)
    ) {
      return FALSE;
    }

    $result = openssl_verify($remoteTimestamp, base64_decode($envelope->signature), $this->getPublicKey());
    return $result === 1;
  }