Release resources. Note that using this class in a with-statement will automatically call :meth:`close`:: with ClientEncryption(...) as client_encryption: encrypted = client_encryption.encrypt(value, ...) decrypted = client_encryption.dec
(self)
| 1262 | raise InvalidOperation("Cannot use closed ClientEncryption") |
| 1263 | |
| 1264 | def close(self) -> None: |
| 1265 | """Release resources. |
| 1266 | |
| 1267 | Note that using this class in a with-statement will automatically call |
| 1268 | :meth:`close`:: |
| 1269 | |
| 1270 | with ClientEncryption(...) as client_encryption: |
| 1271 | encrypted = client_encryption.encrypt(value, ...) |
| 1272 | decrypted = client_encryption.decrypt(encrypted) |
| 1273 | |
| 1274 | """ |
| 1275 | if self._io_callbacks: |
| 1276 | self._io_callbacks.close() |
| 1277 | self._encryption.close() |
| 1278 | self._io_callbacks = None |
| 1279 | self._encryption = None |