pub struct FileDecryptionProperties { /* private fields */ }
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 · 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 From<&FileDecryptionProperties> for ConfigFileDecryptionProperties
impl From<&FileDecryptionProperties> for ConfigFileDecryptionProperties
Source§fn from(f: &FileDecryptionProperties) -> ConfigFileDecryptionProperties
fn from(f: &FileDecryptionProperties) -> ConfigFileDecryptionProperties
Source§impl From<ConfigFileDecryptionProperties> for FileDecryptionProperties
impl From<ConfigFileDecryptionProperties> for FileDecryptionProperties
Source§fn from(val: ConfigFileDecryptionProperties) -> FileDecryptionProperties
fn from(val: ConfigFileDecryptionProperties) -> FileDecryptionProperties
Source§impl PartialEq for FileDecryptionProperties
impl PartialEq for FileDecryptionProperties
impl StructuralPartialEq for FileDecryptionProperties
Auto Trait Implementations§
impl Freeze for FileDecryptionProperties
impl !RefUnwindSafe for FileDecryptionProperties
impl Send for FileDecryptionProperties
impl Sync for FileDecryptionProperties
impl Unpin for FileDecryptionProperties
impl !UnwindSafe for FileDecryptionProperties
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more