Arthur de Jong

Open Source / Free Software developer

summaryrefslogtreecommitdiffstats
path: root/docs/exceptions.rst
blob: 81a73b2eba7242e9d6c7756add4db73cdf9fd9e2 (plain)
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
35
36
37
38
39
40
41
Exceptions
==========

The module and parser will try to interpret any provided PSKC files and will
only raise exceptions on wildly invalid PSKC files.

.. module:: pskc.exceptions

.. exception:: PSKCError

   The base class for all exceptions that the module will raise. In some
   cases third-party code may raise additional exceptions.

.. exception:: ParseError

   Raised when the PSKC file cannot be correctly read due to invalid XML or
   some required element or attribute is missing. This exception should only
   be raised when parsing the file (i.e. when the :class:`~pskc.PSKC` class is
   instantiated).

.. .. exception:: EncryptionError

   Raised when encrypting a value is not possible due to key length issues,
   missing or wrong length plain text, or other issues.

.. exception:: DecryptionError

   Raised when decrypting a value fails due to missing or incorrect key,
   unsupported decryption or MAC algorithm, failed message authentication
   check or other error.

   This exception is generally raised when accessing encrypted information
   (i.e. the :attr:`~pskc.key.Key.secret`, :attr:`~pskc.key.Key.counter`,
   :attr:`~pskc.key.Key.time_offset`, :attr:`~pskc.key.Key.time_interval` or
   :attr:`~pskc.key.Key.time_drift` attributes of the :class:`~pskc.key.Key`
   class).

.. exception:: KeyDerivationError

   Raised when key derivation fails due to an unsupported algorithm or
   missing information in the PSKC file.