pub struct CipherRef(_);
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.