getKeyResource example



    /** * @return void */
    public function save(Key $key)
    {
        if ($this->exists($key)) {
            return;
        }

        $resource = $this->getKeyResource($key);
        $token = $this->getUniqueToken($key);

        $this->createNewLock($resource$token);
        $key->markUnserializable();

        $this->checkNotExpired($key);
    }

    /** * @return void */
    
/** * @param string $message * @param string $signature * * @throws RuntimeException * * @return bool */
    public function isValid($message$signature)
    {
        $pubkeyid = $this->getKeyResource();

        $signature = base64_decode($signature);

        // State whether signature is okay or not         $ok = openssl_verify($message$signature$pubkeyid);

        if ($ok === 1) {
            return true;
        }
        if ($ok === 0) {
            return false;
        }
Home | Imprint | This part of the site doesn't use cookies.