pub struct CipherAlg { /* private fields */ }Expand description
An OpenSSL symmetric cipher algorithm descriptor (EVP_CIPHER*).
Fetched once and reused. Implements Clone via EVP_CIPHER_up_ref.
Implementations§
Source§impl CipherAlg
impl CipherAlg
Sourcepub fn fetch(name: &CStr, props: Option<&CStr>) -> Result<Self, ErrorStack>
pub fn fetch(name: &CStr, props: Option<&CStr>) -> Result<Self, ErrorStack>
Fetch a cipher algorithm from the global default library context.
§Errors
Returns Err if the algorithm is not available.
Sourcepub fn fetch_in(
ctx: &Arc<LibCtx>,
name: &CStr,
props: Option<&CStr>,
) -> Result<Self, ErrorStack>
pub fn fetch_in( ctx: &Arc<LibCtx>, name: &CStr, props: Option<&CStr>, ) -> Result<Self, ErrorStack>
Fetch a cipher algorithm from an explicit library context.
§Errors
Sourcepub fn block_size(&self) -> usize
pub fn block_size(&self) -> usize
Block size in bytes (1 for stream ciphers; 16 for AES).
Sourcepub fn is_aead(&self) -> bool
pub fn is_aead(&self) -> bool
Return true if this is an AEAD cipher (GCM, CCM, ChaCha20-Poly1305).
Sourcepub fn as_ptr(&self) -> *const EVP_CIPHER
pub fn as_ptr(&self) -> *const EVP_CIPHER
Return the raw EVP_CIPHER* pointer. Valid for the lifetime of self.
Trait Implementations§
impl Send for CipherAlg
impl Sync for CipherAlg
Auto Trait Implementations§
impl Freeze for CipherAlg
impl RefUnwindSafe for CipherAlg
impl Unpin for CipherAlg
impl UnsafeUnpin for CipherAlg
impl UnwindSafe for CipherAlg
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