pub struct DecryptionContext { /* private fields */ }Expand description
Holds the decrypted per-tablespace key and IV for page decryption.
Implementations§
Source§impl DecryptionContext
impl DecryptionContext
Sourcepub fn from_encryption_info(
info: &EncryptionInfo,
keyring: &Keyring,
) -> Result<Self, IdbError>
pub fn from_encryption_info( info: &EncryptionInfo, keyring: &Keyring, ) -> Result<Self, IdbError>
Build a decryption context from encryption info and a keyring.
Looks up the master key in the keyring using the server UUID and master key ID from the encryption info, then decrypts the tablespace key+IV using AES-256-ECB, and verifies the CRC32 checksum.
Sourcepub fn decrypt_page(
&self,
page_data: &mut [u8],
page_size: usize,
) -> Result<bool, IdbError>
pub fn decrypt_page( &self, page_data: &mut [u8], page_size: usize, ) -> Result<bool, IdbError>
Decrypt an encrypted page in-place.
Decrypts bytes [38..page_size-8) using AES-256-CBC, then restores the original page type from the FIL header byte 26 (where MySQL saves it before overwriting with the encrypted page type).
Returns Ok(true) if the page was decrypted, Ok(false) if the
page type is not an encrypted type and no decryption was needed.
Sourcepub fn is_encrypted_page(page_data: &[u8]) -> bool
pub fn is_encrypted_page(page_data: &[u8]) -> bool
Check if a page has an encrypted page type.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DecryptionContext
impl RefUnwindSafe for DecryptionContext
impl Send for DecryptionContext
impl Sync for DecryptionContext
impl Unpin for DecryptionContext
impl UnwindSafe for DecryptionContext
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
Mutably borrows from an owned value. Read more