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
Source§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.