Rev 868 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 868 | Rev 1470 | ||
---|---|---|---|
Line 98... | Line 98... | ||
98 | * @return bool - TRUE on valid signature, FALSE on invalid. |
98 | * @return bool - TRUE on valid signature, FALSE on invalid. |
99 | * @throws JwsException |
99 | * @throws JwsException |
100 | */ |
100 | */ |
101 | public function verify($jws) { |
101 | public function verify($jws) { |
102 | $d = $this->prepareVerify($jws); |
102 | $d = $this->prepareVerify($jws); |
103 | return hash_equals($d["sig"], hash_hmac($this->algos[$d["alg"]], $d["h"] . "." . $d["p"], $this->secretKey, true)); |
103 | return hash_equals(hash_hmac($this->algos[$d["alg"]], $d["h"] . "." . $d["p"], $this->secretKey, true), $d["sig"]); |
104 | } |
104 | } |
105 | 105 | ||
106 | /** |
106 | /** |
107 | * Check validity of signature algorithm. |
107 | * Check validity of signature algorithm. |
108 | * @param string $algorithm - Algorithm name. |
108 | * @param string $algorithm - Algorithm name. |