Not a secure cipher - the wrapped key is just the master key concatenated with key bytes
(self, key_bytes, master_key_identifier)
| 31 | self.master_keys_map = config.custom_kms_conf |
| 32 | |
| 33 | def wrap_key(self, key_bytes, master_key_identifier): |
| 34 | """Not a secure cipher - the wrapped key |
| 35 | is just the master key concatenated with key bytes""" |
| 36 | master_key_bytes = self.master_keys_map[master_key_identifier].encode( |
| 37 | 'utf-8') |
| 38 | wrapped_key = b"".join([master_key_bytes, key_bytes]) |
| 39 | result = base64.b64encode(wrapped_key) |
| 40 | return result |
| 41 | |
| 42 | def unwrap_key(self, wrapped_key, master_key_identifier): |
| 43 | """Not a secure cipher - just extract the key from |