pyarrow.parquet.encryption.CryptoFactory#
- class pyarrow.parquet.encryption.CryptoFactory(kms_client_factory)#
Bases:
_WeakrefableA factory that produces the low-level FileEncryptionProperties and FileDecryptionProperties objects, from the high-level parameters.
- __init__()#
Create CryptoFactory.
- Parameters:
- kms_client_factory
acallable()thatacceptsKmsConnectionConfig and returns a KmsClient
- kms_client_factory
Methods
Create CryptoFactory.
file_decryption_properties(self, ...[, ...])Create file decryption properties.
file_encryption_properties(self, ...[, ...])Create file encryption properties.
remove_cache_entries_for_token(self, ...)rotate_master_keys(self, ...[, ...])Rotates master encryption keys for a Parquet file that uses external key material.
- file_decryption_properties(self, KmsConnectionConfig kms_connection_config, DecryptionConfiguration decryption_config=None, parquet_file_path=None, FileSystem filesystem=None)#
Create file decryption properties.
- Parameters:
- kms_connection_config
KmsConnectionConfig Configuration of connection to KMS
- decryption_config
DecryptionConfiguration, defaultNone Configuration of the decryption, such as cache timeout. Can be None.
- parquet_file_path
str,pathlib.Path, orNone, defaultNone Path to the parquet file to be decrypted. Only required when the parquet file uses external key material. Used to derive the path to the external key material file.
- filesystem
FileSystemorNone, defaultNone Used only when the parquet file uses external key material. If None, the file system will be inferred based on parquet_file_path.
- kms_connection_config
- Returns:
- file_decryption_properties
FileDecryptionProperties File decryption properties.
- file_decryption_properties
- file_encryption_properties(self, KmsConnectionConfig kms_connection_config, EncryptionConfiguration encryption_config, parquet_file_path=None, FileSystem filesystem=None)#
Create file encryption properties.
- Parameters:
- kms_connection_config
KmsConnectionConfig Configuration of connection to KMS
- encryption_config
EncryptionConfiguration Configuration of the encryption, such as which columns to encrypt
- parquet_file_path
str,pathlib.Path, orNone, defaultNone Path to the parquet file to be encrypted. Only required when the internal_key_material attribute of EncryptionConfiguration is set to False. Used to derive the path for storing key material specific to this parquet file.
- filesystem
FileSystemorNone, defaultNone Used only when internal_key_material is set to False on EncryptionConfiguration. If None, the file system will be inferred based on parquet_file_path.
- kms_connection_config
- Returns:
- file_encryption_properties
FileEncryptionProperties File encryption properties.
- file_encryption_properties
- remove_cache_entries_for_all_tokens(self)#
- remove_cache_entries_for_token(self, access_token)#
- rotate_master_keys(self, KmsConnectionConfig kms_connection_config, parquet_file_path, FileSystem filesystem=None, double_wrapping=True, cache_lifetime_seconds=600)#
Rotates master encryption keys for a Parquet file that uses external key material.
- Parameters:
- kms_connection_config
KmsConnectionConfig Configuration of connection to KMS
- parquet_file_path
strorpathlib.Path Path to a parquet file using external key material.
- filesystem
FileSystemorNone, defaultNone Used only when the parquet file uses external key material. If None, the file system will be inferred based on parquet_file_path.
- double_wrappingbool, default
True In the single wrapping mode, encrypts data encryption keys with new master keys. In the double wrapping mode, generates new KEKs (key encryption keys) and uses these to encrypt the data keys, and encrypts the KEKs with the new master keys.
- cache_lifetime_seconds
intorfloat, default 600 During key rotation, KMS Client and Key Encryption Keys will be cached for this duration.
- kms_connection_config