A KmsClient implementation that throws exception in wrap/unwrap calls
| 350 | kms_connection_config = pe.KmsConnectionConfig() |
| 351 | |
| 352 | class ThrowingKmsClient(pe.KmsClient): |
| 353 | """A KmsClient implementation that throws exception in |
| 354 | wrap/unwrap calls |
| 355 | """ |
| 356 | |
| 357 | def __init__(self, config): |
| 358 | """Create an InMemoryKmsClient instance.""" |
| 359 | pe.KmsClient.__init__(self) |
| 360 | self.config = config |
| 361 | |
| 362 | def wrap_key(self, key_bytes, master_key_identifier): |
| 363 | raise ValueError("Cannot Wrap Key") |
| 364 | |
| 365 | def unwrap_key(self, wrapped_key, master_key_identifier): |
| 366 | raise ValueError("Cannot Unwrap Key") |
| 367 | |
| 368 | def kms_factory(kms_connection_configuration): |
| 369 | # Exception thrown in wrap/unwrap calls |