forked from Github-Mirrors/canaille
fix: avoid to fail on imports if cryptography is missing
This commit is contained in:
parent
395b6ab4f3
commit
d49e669cab
2 changed files with 9 additions and 5 deletions
|
@ -3,6 +3,11 @@ All notable changes to this project will be documented in this file.
|
|||
The format is based on `Keep a Changelog <https://keepachangelog.com/en/1.0.0/>`_,
|
||||
and this project adheres to `Semantic Versioning <https://semver.org/spec/v2.0.0.html>`_.
|
||||
|
||||
Fixed
|
||||
*****
|
||||
|
||||
- Avoid to fail on imports if ``cryptography`` is missing.
|
||||
|
||||
[0.0.41] - 2023-12-25
|
||||
=====================
|
||||
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
from cryptography.hazmat.backends import default_backend as crypto_default_backend
|
||||
from cryptography.hazmat.primitives import serialization as crypto_serialization
|
||||
from cryptography.hazmat.primitives.asymmetric import rsa
|
||||
|
||||
|
||||
def generate_keypair():
|
||||
from cryptography.hazmat.backends import default_backend as crypto_default_backend
|
||||
from cryptography.hazmat.primitives import serialization as crypto_serialization
|
||||
from cryptography.hazmat.primitives.asymmetric import rsa
|
||||
|
||||
key = rsa.generate_private_key(
|
||||
backend=crypto_default_backend(), public_exponent=65537, key_size=2048
|
||||
)
|
||||
|
|
Loading…
Reference in a new issue