(algorithm)
| 315 | |
| 316 | @staticmethod |
| 317 | def parse_hash(algorithm): |
| 318 | if "-" not in algorithm: |
| 319 | raise UnsupportedAlgorithm(f"Invalid encryption algorithm: {algorithm}") |
| 320 | _pad, _hash = algorithm.split("-", 1) |
| 321 | if _hash not in VALID_HASHES: |
| 322 | raise Exception("Invalid hashing algorithm") |
| 323 | return getattr(hashes, _hash) |
| 324 | |
| 325 | @staticmethod |
| 326 | def _enforce_fips(algorithm): |
no test coverage detected