Debian Codegraph @

ansible_collections/community/crypto/plugins/module_utils/_crypto/basic.py

raw
1 # Copyright (c) 2016, Yanis Guenane <[email protected]>
2 # Copyright (c) 2020, Felix Fontein <[email protected]>
3 # GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
4 # SPDX-License-Identifier: GPL-3.0-or-later
5
6 # Note that this module util is **PRIVATE** to the collection. It can have breaking changes at any time.
7 # Do not use this from other collections or standalone plugins/modules!
8
9 from __future__ import annotations
10
11 try:
12 import cryptography # noqa: F401, pylint: disable=unused-import
13
14 HAS_CRYPTOGRAPHY = True
15 except ImportError:
16 # Error handled in the calling module.
17 HAS_CRYPTOGRAPHY = False
18
19
20 class OpenSSLObjectError(Exception):
21 pass
22
23
24 class OpenSSLBadPassphraseError(OpenSSLObjectError):
25 pass
26
27
28 __all__ = ("HAS_CRYPTOGRAPHY", "OpenSSLBadPassphraseError", "OpenSSLObjectError")