Alex Gaynor | f1a3fc0 | 2013-11-02 14:03:34 -0700 | [diff] [blame] | 1 | Exceptions |
| 2 | ========== |
| 3 | |
| 4 | .. currentmodule:: cryptography.exceptions |
| 5 | |
David Reid | 6392a9c | 2013-11-13 10:01:15 -0800 | [diff] [blame] | 6 | .. class:: AlreadyFinalized |
| 7 | |
David Reid | 00fb12a | 2013-11-13 13:02:44 -0800 | [diff] [blame] | 8 | This is raised when a context is used after being finalized. |
David Reid | 6392a9c | 2013-11-13 10:01:15 -0800 | [diff] [blame] | 9 | |
Paul Kehrer | ce9c611 | 2013-11-22 14:10:59 -0600 | [diff] [blame] | 10 | |
Julian Krause | c91fe6a | 2013-12-25 11:00:49 -0800 | [diff] [blame] | 11 | .. class:: InvalidSignature |
| 12 | |
Paul Kehrer | 42b3713 | 2014-02-23 19:13:19 -0600 | [diff] [blame^] | 13 | This is raised when signature verification fails. This can occur with |
| 14 | HMAC or asymmetric key signature validation. |
Julian Krause | c91fe6a | 2013-12-25 11:00:49 -0800 | [diff] [blame] | 15 | |
| 16 | |
Paul Kehrer | ce9c611 | 2013-11-22 14:10:59 -0600 | [diff] [blame] | 17 | .. class:: NotYetFinalized |
Paul Kehrer | 22e80cb | 2013-11-20 21:27:00 -0600 | [diff] [blame] | 18 | |
| 19 | This is raised when the AEAD tag property is accessed on a context |
| 20 | before it is finalized. |
| 21 | |
David Reid | 6392a9c | 2013-11-13 10:01:15 -0800 | [diff] [blame] | 22 | |
Paul Kehrer | ce9c611 | 2013-11-22 14:10:59 -0600 | [diff] [blame] | 23 | .. class:: AlreadyUpdated |
| 24 | |
| 25 | This is raised when additional data is added to a context after update |
| 26 | has already been called. |
| 27 | |
| 28 | |
Alex Gaynor | 3949f11 | 2013-11-02 16:57:10 -0700 | [diff] [blame] | 29 | .. class:: UnsupportedAlgorithm |
Alex Gaynor | f1a3fc0 | 2013-11-02 14:03:34 -0700 | [diff] [blame] | 30 | |
| 31 | This is raised when a backend doesn't support the requested algorithm (or |
| 32 | combination of algorithms). |
Alex Gaynor | b2774f5 | 2014-01-27 11:05:29 -0800 | [diff] [blame] | 33 | |
| 34 | |
| 35 | .. class:: InvalidKey |
| 36 | |
Alex Gaynor | 288403a | 2014-01-27 15:59:17 -0800 | [diff] [blame] | 37 | This is raised when the verify method of a key derivation function's |
| 38 | computed key does not match the expected key. |
Ayrx | b5189af | 2014-02-13 18:52:31 +0800 | [diff] [blame] | 39 | |
| 40 | |
| 41 | .. class:: InvalidToken |
| 42 | |
| 43 | This is raised when the verify method of a one time password function's |
| 44 | computed token does not match the expected token. |
Paul Kehrer | 4ccceaf | 2014-02-23 11:26:37 -0600 | [diff] [blame] | 45 | |
| 46 | |
Paul Kehrer | 0377f5a | 2014-02-24 19:04:46 -0600 | [diff] [blame] | 47 | .. class:: UnsupportedPadding |
Paul Kehrer | 4ccceaf | 2014-02-23 11:26:37 -0600 | [diff] [blame] | 48 | |
Paul Kehrer | 0377f5a | 2014-02-24 19:04:46 -0600 | [diff] [blame] | 49 | This is raised when the chosen padding is not supported by the backend. |