pyarrow.parquet.encryption.create_decryption_properties#
- pyarrow.parquet.encryption.create_decryption_properties(footer_key, *, aad_prefix=None, bool check_footer_integrity=True, bool allow_plaintext_files=False)#
Create FileDecryptionProperties using a direct footer key.
This is a low-level API that constructs decryption properties directly from a plaintext key, bypassing the KMS-based
CryptoFactory. It is intended for callers that manage key wrapping and storage themselves (e.g. an application-level scheme).For most use cases, prefer the higher-level
CryptoFactorywithDecryptionConfiguration, which implements the full Parquet key management specification and is interoperable with other tools and frameworks.Note
Currently only uniform encryption (single key for footer and all columns) is supported with this method. Per-column keys are not yet available; files encrypted with per-column keys cannot be decrypted using this function.
- Parameters:
- footer_key
bytes The decryption key for the file footer and all columns (uniform encryption). Must be 16, 24, or 32 bytes for AES-128, AES-192, or AES-256 respectively.
- aad_prefix
bytes, optional Additional Authenticated Data prefix. Must match the AAD prefix that was used during encryption. Required if the AAD prefix was not stored in the file metadata during encryption.
- check_footer_integritybool, default
True Whether to verify footer integrity using the signature stored in the file. Set to False only for debugging.
- allow_plaintext_filesbool, default
False Whether to allow reading plaintext (unencrypted) files with these decryption properties without raising an error.
- footer_key
- Returns:
FileDecryptionPropertiesProperties that can be passed to
read_table(),ParquetFile, orParquetFragmentScanOptions.
Examples
>>> import pyarrow.parquet as pq >>> import pyarrow.parquet.encryption as pe >>> props = pe.create_decryption_properties( ... footer_key=b'0123456789abcdef', ... aad_prefix=b'table_id', ... ) >>> table = pq.read_table('encrypted.parquet', decryption_properties=props)