-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCryptoException.php
More file actions
34 lines (30 loc) · 1.02 KB
/
Copy pathCryptoException.php
File metadata and controls
34 lines (30 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<?php
/*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
/**
* Italix Crypto - Exception
*
* @package Italix\Crypto
*/
declare(strict_types=1);
namespace Italix\Crypto;
use RuntimeException;
/**
* The library cannot do what was asked: a key of the wrong length, a missing
* extension, a store that will not answer.
*
* Deliberately **not** what a failed verification raises. A tampered token, an
* expired one or a wrong purpose are ordinary results — they arrive from the
* network and happen constantly — so `verify()` returns `Claims` with an
* `error_code()`, exactly as `Italix\Rules` returns an outcome rather than
* throwing on invalid input. Throwing on attacker-controlled data hands out a
* remotely triggerable 500.
*
* This exception is for the operator's mistakes, not the visitor's.
*/
final class CryptoException extends RuntimeException
{
}