Exceptions

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

exception pskc.exceptions.PSKCError

General top-level exception.

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

exception pskc.exceptions.ParseError

Something went wrong with parsing the PSKC file.

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 PSKC class is instantiated).

exception pskc.exceptions.EncryptionError

There was a problem encrypting the value.

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

exception pskc.exceptions.DecryptionError

There was a problem decrypting the value.

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 secret, counter, time_offset, time_interval or time_drift attributes of the Key class).

exception pskc.exceptions.KeyDerivationError

There was a problem performing the key derivation.

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