diff --git a/yubikit/piv.py b/yubikit/piv.py index 4fef71d9..282f23db 100755 --- a/yubikit/piv.py +++ b/yubikit/piv.py @@ -165,7 +165,12 @@ def challenge_len(self) -> int: def _parse_management_key(key_type, management_key): if key_type == MANAGEMENT_KEY_TYPE.TDES: - return algorithms.TripleDES(management_key) + # TripleDES moved to decrepit in cryptography 43 + try: + from cryptography.hazmat.decrepit.ciphers.algorithms import TripleDES + except ImportError: + TripleDES = algorithms.TripleDES + return TripleDES(management_key) else: return algorithms.AES(management_key)