pub enum EncryptKey {
Aes128([u8; 16]),
Aes192([u8; 24]),
Aes256([u8; 32]),
}Expand description
Represents an encryption key that will give confidentiality to
data stored within the redo-log. Note this does not give integrity
which comes from the PrivateKey crypto instead.
Variants§
Implementations§
Source§impl EncryptKey
impl EncryptKey
pub fn generate(size: KeySize) -> EncryptKey
pub fn resize(&self, size: KeySize) -> EncryptKey
pub fn size(&self) -> KeySize
pub fn value(&self) -> &[u8] ⓘ
pub fn encrypt_with_iv(&self, iv: &InitializationVector, data: &[u8]) -> Vec<u8> ⓘ
pub fn encrypt_with_hash_iv(&self, hash: &AteHash, data: &[u8]) -> Vec<u8> ⓘ
pub fn encrypt_with_hash_iv_with_capacity( &self, hash: &AteHash, data: &[u8], capacity: usize, ) -> Vec<u8> ⓘ
pub fn encrypt_with_hash_iv_with_capacity_and_prefix( &self, hash: &AteHash, data: &[u8], capacity: usize, prefix: &[u8], ) -> Vec<u8> ⓘ
pub fn encrypt(&self, data: &[u8]) -> EncryptResult
pub fn decrypt(&self, iv: &InitializationVector, data: &[u8]) -> Vec<u8> ⓘ
pub fn decrypt_with_hash_iv(&self, hash: &AteHash, data: &[u8]) -> Vec<u8> ⓘ
pub fn as_bytes(&self) -> Vec<u8> ⓘ
pub fn from_bytes(bytes: &[u8]) -> Result<EncryptKey, Error>
pub fn hash(&self) -> AteHash
pub fn short_hash(&self) -> ShortHash
pub fn from_seed_string(str: String, size: KeySize) -> EncryptKey
pub fn from_seed_bytes(seed_bytes: &[u8], size: KeySize) -> EncryptKey
pub fn xor(ek1: &EncryptKey, ek2: &EncryptKey) -> EncryptKey
Trait Implementations§
Source§impl Clone for EncryptKey
impl Clone for EncryptKey
Source§fn clone(&self) -> EncryptKey
fn clone(&self) -> EncryptKey
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 EncryptKey
impl Debug for EncryptKey
Source§impl<'de> Deserialize<'de> for EncryptKey
impl<'de> Deserialize<'de> for EncryptKey
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for EncryptKey
impl Display for EncryptKey
Source§impl Hash for EncryptKey
impl Hash for EncryptKey
Source§impl Ord for EncryptKey
impl Ord for EncryptKey
Source§fn cmp(&self, other: &EncryptKey) -> Ordering
fn cmp(&self, other: &EncryptKey) -> 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 EncryptKey
impl PartialEq for EncryptKey
Source§impl PartialOrd for EncryptKey
impl PartialOrd for EncryptKey
Source§impl Serialize for EncryptKey
impl Serialize for EncryptKey
impl Copy for EncryptKey
impl Eq for EncryptKey
impl StructuralPartialEq for EncryptKey
Auto Trait Implementations§
impl Freeze for EncryptKey
impl RefUnwindSafe for EncryptKey
impl Send for EncryptKey
impl Sync for EncryptKey
impl Unpin for EncryptKey
impl UnwindSafe for EncryptKey
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.