MCPcopy Create free account
hub / github.com/apache/arrow / wrap_key

Method wrap_key

python/pyarrow/tests/parquet/encryption.py:33–40  ·  view source on GitHub ↗

Not a secure cipher - the wrapped key is just the master key concatenated with key bytes

(self, key_bytes, master_key_identifier)

Source from the content-addressed store, hash-verified

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

Callers 1

WrapKeyMethod · 0.45

Calls 2

encodeMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected