(algorithm)
| 306 | |
| 307 | @staticmethod |
| 308 | def parse_padding_for_encryption(algorithm): |
| 309 | if algorithm not in VALID_ENCRYPTION_ALGORITHMS: |
| 310 | raise UnsupportedAlgorithm(f"Invalid encryption algorithm: {algorithm}") |
| 311 | _pad, _hash = algorithm.split("-", 1) |
| 312 | if _pad not in VALID_PADDING_FOR_ENCRYPTION: |
| 313 | raise UnsupportedAlgorithm(f"Invalid padding algorithm: {_pad}") |
| 314 | return getattr(padding, _pad) |
| 315 | |
| 316 | @staticmethod |
| 317 | def parse_hash(algorithm): |
no test coverage detected