Skip to main content

FileDecryptionProperties

Struct FileDecryptionProperties 

Source
pub struct FileDecryptionProperties { /* private fields */ }
Available on crate feature 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

Source

pub fn builder(footer_key: Vec<u8>) -> DecryptionPropertiesBuilder

Returns a new FileDecryptionProperties builder that will use the provided key to decrypt footer metadata.

Source

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.

Source

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.

Source

pub fn footer_key( &self, key_metadata: Option<&[u8]>, ) -> Result<Cow<'_, Vec<u8>>, ParquetError>

Get the encryption key for decrypting a file’s footer, and also column data if uniform encryption is used.

Source

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

Source

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.

Source

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

Source§

fn clone(&self) -> FileDecryptionProperties

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for FileDecryptionProperties

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl PartialEq for FileDecryptionProperties

Source§

fn eq(&self, other: &FileDecryptionProperties) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for FileDecryptionProperties

Source§

impl TryFrom<ConfigFileDecryptionProperties> for FileDecryptionProperties

Source§

type Error = DataFusionError

The type returned in the event of a conversion error.
Source§

fn try_from(val: ConfigFileDecryptionProperties) -> Result<Self>

Performs the conversion.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.