Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
FileDecryptionProperties in datafusion::common::encryption - Rust
[go: Go Back, main page]

Struct FileDecryptionProperties

Source
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

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.

Trait Implementations§

Source§

impl Clone for FileDecryptionProperties

Source§

fn clone(&self) -> FileDecryptionProperties

Returns a duplicate of the value. Read more
1.0.0 · 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 From<&FileDecryptionProperties> for ConfigFileDecryptionProperties

Source§

fn from(f: &FileDecryptionProperties) -> ConfigFileDecryptionProperties

Converts to this type from the input type.
Source§

impl From<ConfigFileDecryptionProperties> for FileDecryptionProperties

Source§

fn from(val: ConfigFileDecryptionProperties) -> FileDecryptionProperties

Converts to this type from the input type.
Source§

impl PartialEq for FileDecryptionProperties

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for FileDecryptionProperties

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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> Ungil for T
where T: Send,