(self, data, algorithm=OAEP_SHA1)
| 368 | raise UnsupportedAlgorithm(f"Unsupported algorithm: {algorithm}") |
| 369 | |
| 370 | def decrypt(self, data, algorithm=OAEP_SHA1): |
| 371 | _padding = self.parse_padding_for_encryption(algorithm) |
| 372 | _hash = self.parse_hash(algorithm) |
| 373 | self._enforce_fips(algorithm) |
| 374 | try: |
| 375 | return self.key.decrypt( |
| 376 | data, |
| 377 | _padding( |
| 378 | mgf=padding.MGF1(algorithm=_hash()), |
| 379 | algorithm=_hash(), |
| 380 | label=None, |
| 381 | ), |
| 382 | ) |
| 383 | except cryptography.exceptions.UnsupportedAlgorithm: |
| 384 | raise UnsupportedAlgorithm(f"Unsupported algorithm: {algorithm}") |
| 385 | |
| 386 | def write_private(self, keydir, name, passphrase=None): |
| 387 | _write_private(keydir, name, self.key, passphrase) |
nothing calls this directly
no test coverage detected