pub struct FileDecryptionProperties { /* private fields */ }parquet_encryption only.Expand description
FileDecryptionProperties hold keys and AAD data required to decrypt a Parquet file.
When reading Arrow data, the FileDecryptionProperties should be included in the
ArrowReaderOptions using
with_file_decryption_properties.
§Examples
Create FileDecryptionProperties for a file encrypted with uniform encryption,
where all metadata and data are encrypted with the footer key:
let file_encryption_properties = FileDecryptionProperties::builder(b"0123456789012345".into())
.build()?;Create properties for a file where columns are encrypted with different keys:
let file_encryption_properties = FileDecryptionProperties::builder(b"0123456789012345".into())
.with_column_key("x", b"1234567890123450".into())
.with_column_key("y", b"1234567890123451".into())
.build()?;Specify additional authenticated data, used to protect against data replacement. This must match the AAD prefix provided when the file was written, otherwise data decryption will fail.
let file_encryption_properties = FileDecryptionProperties::builder(b"0123456789012345".into())
.with_aad_prefix("example_file".into())
.build()?;Implementations§
Source§impl FileDecryptionProperties
impl FileDecryptionProperties
Sourcepub fn builder(footer_key: Vec<u8>) -> DecryptionPropertiesBuilder
pub fn builder(footer_key: Vec<u8>) -> DecryptionPropertiesBuilder
Returns a new FileDecryptionProperties builder that will use the provided key to
decrypt footer metadata.
Sourcepub fn with_key_retriever(
key_retriever: Arc<dyn KeyRetriever>,
) -> DecryptionPropertiesBuilderWithRetriever
pub fn with_key_retriever( key_retriever: Arc<dyn KeyRetriever>, ) -> DecryptionPropertiesBuilderWithRetriever
Returns a new FileDecryptionProperties builder that uses a KeyRetriever
to get decryption keys based on key metadata.
Sourcepub fn aad_prefix(&self) -> Option<&Vec<u8>>
pub fn aad_prefix(&self) -> Option<&Vec<u8>>
AAD prefix string uniquely identifies the file and prevents file swapping
Returns true if footer signature verification is enabled for files with plaintext footers.
Get the encryption key for decrypting a file’s footer, and also column data if uniform encryption is used.
Sourcepub fn column_key(
&self,
column_name: &str,
key_metadata: Option<&[u8]>,
) -> Result<Cow<'_, Vec<u8>>, ParquetError>
pub fn column_key( &self, column_name: &str, key_metadata: Option<&[u8]>, ) -> Result<Cow<'_, Vec<u8>>, ParquetError>
Get the column-specific encryption key for decrypting column data and metadata within a file
Sourcepub fn column_keys(&self) -> (Vec<String>, Vec<Vec<u8>>)
pub fn column_keys(&self) -> (Vec<String>, Vec<Vec<u8>>)
Get the column names and associated decryption keys that have been configured. If a key retriever is used rather than explicit decryption keys, the result will be empty. Provided for testing consumer code.
Sourcepub fn uses_key_retriever(&self) -> bool
pub fn uses_key_retriever(&self) -> bool
Whether these decryption properties use a key retriever. When false, explicit keys were provided up front and can be retrieved without providing key metadata, rather than resolved on demand.
Trait Implementations§
Source§impl Clone for FileDecryptionProperties
impl Clone for FileDecryptionProperties
Source§fn clone(&self) -> FileDecryptionProperties
fn clone(&self) -> FileDecryptionProperties
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more