Source code for pyflocker.ciphers.exc
"""Exceptions raised by the ciphers are defined here."""
from __future__ import annotations
[docs]
class DecryptionError(Exception):
"""
Can be raised in two cases:
- AEAD ciphers failed to verify the decryption.
- Asymmetric ciphers (RSA) failed to decrypt the data.
"""
[docs]
class FinalizationError(Exception):
"""
Base exception class for all finalization and context
destruction related errors.
"""
[docs]
class UnsupportedAlgorithm(Exception):
"""Raised if the backend does not support the algorithm."""
NotYetFinalized = NotFinalized