pub struct CryptoBlock<'pool> { /* private fields */ }Expand description
Encryption/decryption block handle.
Implementations§
Source§impl<'pool> CryptoBlock<'pool>
impl<'pool> CryptoBlock<'pool>
Sourcepub fn encrypt_init(
key: &CryptoKey<'_>,
iv: Option<&[u8]>,
pool: &'pool Pool<'pool>,
) -> Result<Self, Error>
pub fn encrypt_init( key: &CryptoKey<'_>, iv: Option<&[u8]>, pool: &'pool Pool<'pool>, ) -> Result<Self, Error>
Create a new encryption block.
Sourcepub fn decrypt_init(
key: &CryptoKey<'_>,
iv: Option<&[u8]>,
pool: &'pool Pool<'pool>,
) -> Result<Self, Error>
pub fn decrypt_init( key: &CryptoKey<'_>, iv: Option<&[u8]>, pool: &'pool Pool<'pool>, ) -> Result<Self, Error>
Create a new decryption block.
Sourcepub fn encrypt(&mut self, plaintext: &[u8]) -> Result<Vec<u8>, Error>
pub fn encrypt(&mut self, plaintext: &[u8]) -> Result<Vec<u8>, Error>
Encrypt data using this block.
Sourcepub fn decrypt(&mut self, ciphertext: &[u8]) -> Result<Vec<u8>, Error>
pub fn decrypt(&mut self, ciphertext: &[u8]) -> Result<Vec<u8>, Error>
Decrypt data using this block.
Sourcepub fn as_ptr(&self) -> *mut apr_crypto_block_t
pub fn as_ptr(&self) -> *mut apr_crypto_block_t
Get the raw APR crypto block pointer.
Trait Implementations§
Auto Trait Implementations§
impl<'pool> Freeze for CryptoBlock<'pool>
impl<'pool> RefUnwindSafe for CryptoBlock<'pool>
impl<'pool> !Send for CryptoBlock<'pool>
impl<'pool> !Sync for CryptoBlock<'pool>
impl<'pool> Unpin for CryptoBlock<'pool>
impl<'pool> UnsafeUnpin for CryptoBlock<'pool>
impl<'pool> UnwindSafe for CryptoBlock<'pool>
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