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
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 moreSource§impl Debug for FileDecryptionProperties
impl Debug for FileDecryptionProperties
Source§impl PartialEq for FileDecryptionProperties
impl PartialEq for FileDecryptionProperties
Source§fn eq(&self, other: &FileDecryptionProperties) -> bool
fn eq(&self, other: &FileDecryptionProperties) -> bool
self and other values to be equal, and is used by ==.