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 SignatureError(Exception): """Raised when the signature is invalid."""
[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."""
[docs] class UnsupportedMode(Exception): """Raised if the backend does not support the mode."""
[docs] class AlreadyFinalized(FinalizationError): """The context was already destroyed."""
[docs] class NotFinalized(FinalizationError): """The context has not been destroyed yet."""
NotYetFinalized = NotFinalized