File tree Expand file tree Collapse file tree 4 files changed +4
-11
lines changed Expand file tree Collapse file tree 4 files changed +4
-11
lines changed Original file line number Diff line number Diff line change @@ -48,7 +48,7 @@ scripts =
48
48
tools/parse_xsd2.py
49
49
python_requires = >=3.6, <4
50
50
install_requires =
51
- cryptography >= 1.4
51
+ cryptography >= 3.1
52
52
defusedxml
53
53
pyOpenSSL
54
54
python-dateutil
Original file line number Diff line number Diff line change 1
1
"""This module provides methods for asymmetric cryptography."""
2
2
3
- import cryptography .hazmat .backends as _backends
4
3
import cryptography .hazmat .primitives .asymmetric as _asymmetric
5
4
import cryptography .hazmat .primitives .hashes as _hashes
6
5
import cryptography .hazmat .primitives .serialization as _serialization
7
6
8
7
9
8
def load_pem_private_key (data , password ):
10
9
"""Load RSA PEM certificate."""
11
- key = _serialization .load_pem_private_key (
12
- data , password , _backends .default_backend ())
10
+ key = _serialization .load_pem_private_key (data , password )
13
11
return key
14
12
15
13
Original file line number Diff line number Diff line change 1
1
"""This module provides methods for PKI operations."""
2
2
3
- import cryptography .hazmat .backends as _backends
4
3
import cryptography .x509 as _x509
5
4
6
5
7
6
def load_pem_x509_certificate (data ):
8
7
"""Load X.509 PEM certificate."""
9
- return _x509 .load_pem_x509_certificate (data , _backends . default_backend () )
8
+ return _x509 .load_pem_x509_certificate (data )
Original file line number Diff line number Diff line change 10
10
from warnings import warn as _warn
11
11
12
12
import cryptography .fernet as _fernet
13
- import cryptography .hazmat .backends as _backends
14
13
import cryptography .hazmat .primitives .ciphers as _ciphers
15
14
16
15
from .errors import SymmetricCryptographyError
@@ -158,10 +157,7 @@ def build_cipher(self, alg='aes_128_cbc'):
158
157
except KeyError :
159
158
raise Exception ('Unsupported chaining mode: {}' .format (cmode ))
160
159
161
- cipher = _ciphers .Cipher (
162
- _ciphers .algorithms .AES (self .key ),
163
- mode (iv ),
164
- backend = _backends .default_backend ())
160
+ cipher = _ciphers .Cipher (_ciphers .algorithms .AES (self .key ), mode (iv ))
165
161
166
162
return cipher , iv
167
163
You can’t perform that action at this time.
0 commit comments