Coverage for /home/martinb/.local/share/virtualenvs/camcops/lib/python3.6/site-packages/cryptography/exceptions.py : 88%

Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
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.
6from enum import Enum
9class _Reasons(Enum):
10 BACKEND_MISSING_INTERFACE = 0
11 UNSUPPORTED_HASH = 1
12 UNSUPPORTED_CIPHER = 2
13 UNSUPPORTED_PADDING = 3
14 UNSUPPORTED_MGF = 4
15 UNSUPPORTED_PUBLIC_KEY_ALGORITHM = 5
16 UNSUPPORTED_ELLIPTIC_CURVE = 6
17 UNSUPPORTED_SERIALIZATION = 7
18 UNSUPPORTED_X509 = 8
19 UNSUPPORTED_EXCHANGE_ALGORITHM = 9
20 UNSUPPORTED_DIFFIE_HELLMAN = 10
21 UNSUPPORTED_MAC = 11
24class UnsupportedAlgorithm(Exception):
25 def __init__(self, message, reason=None):
26 super(UnsupportedAlgorithm, self).__init__(message)
27 self._reason = reason
30class AlreadyFinalized(Exception):
31 pass
34class AlreadyUpdated(Exception):
35 pass
38class NotYetFinalized(Exception):
39 pass
42class InvalidTag(Exception):
43 pass
46class InvalidSignature(Exception):
47 pass
50class InternalError(Exception):
51 def __init__(self, msg, err_code):
52 super(InternalError, self).__init__(msg)
53 self.err_code = err_code
56class InvalidKey(Exception):
57 pass