mirror of
https://github.com/ansible-collections/community.crypto.git
synced 2026-03-27 13:53:24 +00:00
* Stop passing backend to cryptography. * Make public_bytes() fallback the default. * Remove compatibility code for older cryptography versions. * Require cryptography 3.4+. * Restrict to cryptography >= 3.4 in integration tests. * Remove Debian Bullseye from CI. It only supports cryptography 3.3. * Improve imports. * Remove no longer existing conditional.
24 lines
623 B
Python
24 lines
623 B
Python
# Copyright (c) 2016, Yanis Guenane <yanis+ansible@guenane.org>
|
|
# Copyright (c) 2020, Felix Fontein <felix@fontein.de>
|
|
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
|
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
from __future__ import annotations
|
|
|
|
|
|
try:
|
|
import cryptography # noqa: F401, pylint: disable=unused-import
|
|
|
|
HAS_CRYPTOGRAPHY = True
|
|
except ImportError:
|
|
# Error handled in the calling module.
|
|
HAS_CRYPTOGRAPHY = False
|
|
|
|
|
|
class OpenSSLObjectError(Exception):
|
|
pass
|
|
|
|
|
|
class OpenSSLBadPassphraseError(OpenSSLObjectError):
|
|
pass
|