pub struct DefaultEncryptor;Expand description
Default encryptor
Trait Implementations§
Source§impl Clone for DefaultEncryptor
impl Clone for DefaultEncryptor
Source§fn clone(&self) -> DefaultEncryptor
fn clone(&self) -> DefaultEncryptor
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DefaultEncryptor
impl Debug for DefaultEncryptor
Source§impl Default for DefaultEncryptor
impl Default for DefaultEncryptor
Source§fn default() -> DefaultEncryptor
fn default() -> DefaultEncryptor
Returns the “default value” for a type. Read more
Source§impl Encryptor for DefaultEncryptor
impl Encryptor for DefaultEncryptor
Source§fn encrypt(
dst: &mut [u8],
key: &[u8],
iv: &[u8],
algo: EncryptionAlgorithm,
) -> Result<(), Self::Error>
fn encrypt( dst: &mut [u8], key: &[u8], iv: &[u8], algo: EncryptionAlgorithm, ) -> Result<(), Self::Error>
Encrypts self with IV. Can be used for both encryption and decryption.
IV:
- EncryptionAlgorithm::Aes: IV is of AES block size.
- EncryptionAlgorithm::None: IV is ignored.
Source§fn encrypt_into_vec(
src: &[u8],
key: &[u8],
iv: &[u8],
algo: EncryptionAlgorithm,
) -> Result<Vec<u8>, Self::Error>
fn encrypt_into_vec( src: &[u8], key: &[u8], iv: &[u8], algo: EncryptionAlgorithm, ) -> Result<Vec<u8>, Self::Error>
Encrypts self with IV to a new Vec.
Can be used for both encryption and decryption.
IV:
- EncryptionAlgorithm::Aes: IV is of AES block size.
- EncryptionAlgorithm::None: IV is ignored.
Source§fn encrypt_to(
src: &[u8],
dst: &mut [u8],
key: &[u8],
iv: &[u8],
algo: EncryptionAlgorithm,
) -> Result<(), Self::Error>
fn encrypt_to( src: &[u8], dst: &mut [u8], key: &[u8], iv: &[u8], algo: EncryptionAlgorithm, ) -> Result<(), Self::Error>
Encrypts self with IV to dst.
Can be used for both encryption and decryption.
IV:
- EncryptionAlgorithm::Aes: IV is of AES block size.
- EncryptionAlgorithm::None: IV is ignored.
Source§fn encrypt_into_bytes(
src: &[u8],
key: &[u8],
iv: &[u8],
algo: EncryptionAlgorithm,
) -> Result<Bytes, Self::Error>
fn encrypt_into_bytes( src: &[u8], key: &[u8], iv: &[u8], algo: EncryptionAlgorithm, ) -> Result<Bytes, Self::Error>
Encrypts self with IV to a new
bytes::Bytes.
Can be used for both encryption and decryption. Read moreSource§fn is_valid_private_key(secret: &[u8], algo: EncryptionAlgorithm) -> bool
fn is_valid_private_key(secret: &[u8], algo: EncryptionAlgorithm) -> bool
Check if the private key length is valid
Source§impl Hash for DefaultEncryptor
impl Hash for DefaultEncryptor
Source§impl Ord for DefaultEncryptor
impl Ord for DefaultEncryptor
Source§fn cmp(&self, other: &DefaultEncryptor) -> Ordering
fn cmp(&self, other: &DefaultEncryptor) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for DefaultEncryptor
impl PartialEq for DefaultEncryptor
Source§impl PartialOrd for DefaultEncryptor
impl PartialOrd for DefaultEncryptor
impl Copy for DefaultEncryptor
impl Eq for DefaultEncryptor
impl StructuralPartialEq for DefaultEncryptor
Auto Trait Implementations§
impl Freeze for DefaultEncryptor
impl RefUnwindSafe for DefaultEncryptor
impl Send for DefaultEncryptor
impl Sync for DefaultEncryptor
impl Unpin for DefaultEncryptor
impl UnwindSafe for DefaultEncryptor
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