Funktionierender Prototyp des Serious Games zur Vermittlung von Wissen zu Software-Engineering-Arbeitsmodellen.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

exceptions.py 1.1KB

1 year ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. # This file is dual licensed under the terms of the Apache License, Version
  2. # 2.0, and the BSD License. See the LICENSE file in the root of this repository
  3. # for complete details.
  4. from __future__ import annotations
  5. import typing
  6. from cryptography.hazmat.bindings._rust import exceptions as rust_exceptions
  7. if typing.TYPE_CHECKING:
  8. from cryptography.hazmat.bindings._rust import openssl as rust_openssl
  9. _Reasons = rust_exceptions._Reasons
  10. class UnsupportedAlgorithm(Exception):
  11. def __init__(
  12. self, message: str, reason: typing.Optional[_Reasons] = None
  13. ) -> None:
  14. super().__init__(message)
  15. self._reason = reason
  16. class AlreadyFinalized(Exception):
  17. pass
  18. class AlreadyUpdated(Exception):
  19. pass
  20. class NotYetFinalized(Exception):
  21. pass
  22. class InvalidTag(Exception):
  23. pass
  24. class InvalidSignature(Exception):
  25. pass
  26. class InternalError(Exception):
  27. def __init__(
  28. self, msg: str, err_code: typing.List[rust_openssl.OpenSSLError]
  29. ) -> None:
  30. super().__init__(msg)
  31. self.err_code = err_code
  32. class InvalidKey(Exception):
  33. pass