pub struct CipherRef(/* private fields */);
Expand description
A reference to a Cipher
.
Implementations§
source§impl CipherRef
impl CipherRef
sourcepub fn nid(&self) -> Nid
pub fn nid(&self) -> Nid
Returns the cipher’s Nid.
This corresponds to EVP_CIPHER_nid
.
sourcepub fn key_length(&self) -> usize
pub fn key_length(&self) -> usize
Returns the length of keys used with this cipher.
This corresponds to EVP_CIPHER_key_length
.
sourcepub fn iv_length(&self) -> usize
pub fn iv_length(&self) -> usize
Returns the length of the IV used with this cipher.
§Note
Ciphers that do not use an IV have an IV length of 0.
This corresponds to EVP_CIPHER_iv_length
.
sourcepub fn block_size(&self) -> usize
pub fn block_size(&self) -> usize
Returns the block size of the cipher.
§Note
Stream ciphers have a block size of 1.
This corresponds to EVP_CIPHER_block_size
.
Trait Implementations§
source§impl ForeignTypeRef for CipherRef
impl ForeignTypeRef for CipherRef
§type CType = EVP_CIPHER
type CType = EVP_CIPHER
The raw C type.
source§unsafe fn from_ptr<'a>(ptr: *mut Self::CType) -> &'a Self
unsafe fn from_ptr<'a>(ptr: *mut Self::CType) -> &'a Self
Constructs a shared instance of this type from its raw type.
source§unsafe fn from_ptr_mut<'a>(ptr: *mut Self::CType) -> &'a mut Self
unsafe fn from_ptr_mut<'a>(ptr: *mut Self::CType) -> &'a mut Self
Constructs a mutable reference of this type from its raw type.
impl Send for CipherRef
impl Sync for CipherRef
Auto Trait Implementations§
impl !Freeze for CipherRef
impl !RefUnwindSafe for CipherRef
impl Unpin for CipherRef
impl UnwindSafe for CipherRef
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