static function timestamp($hash, $clientTime = "", $requester = "") { $me = new self($requester, 2048); $keys = $me->getKeys(); return (object) array("timestamp" => urlencode($me->encrypt($hash . $clientTime . time())), "authority" => TikiLib::tikiUrl(), "requester" => $requester, "publickey" => $keys->publickey, "href" => TikiLib::tikiUrl() . "tiki-tskeys.php"); }
/** * Unit test * @ignore */ public static function __test() { $x = new self('abcdefghijklmnop'); assert(base64_encode($x->encrypt('Hello')) == 'aCVjUPXOAknwRDyq'); assert($x->decrypt(base64_decode('aCVjUPXOAknwRDyq')) == 'Hello'); }