[−][src]Struct sync15::key_bundle::KeyBundle
Fields
enc_key: Vec<u8>
mac_key: Vec<u8>
Implementations
impl KeyBundle
[src]
pub fn new(enc: Vec<u8>, mac: Vec<u8>) -> Result<KeyBundle>
[src]
Construct a key bundle from the already-decoded encrypt and hmac keys. Panics (asserts) if they aren't both 32 bytes.
pub fn new_random() -> Result<KeyBundle>
[src]
pub fn from_ksync_bytes(ksync: &[u8]) -> Result<KeyBundle>
[src]
pub fn from_ksync_base64(ksync: &str) -> Result<KeyBundle>
[src]
pub fn from_base64(enc: &str, mac: &str) -> Result<KeyBundle>
[src]
pub fn encryption_key(&self) -> &[u8]
[src]
pub fn hmac_key(&self) -> &[u8]
[src]
pub fn to_b64_array(&self) -> [String; 2]
[src]
pub fn decrypt(
&self,
enc_base64: &str,
iv_base64: &str,
hmac_base16: &str
) -> Result<String>
[src]
&self,
enc_base64: &str,
iv_base64: &str,
hmac_base16: &str
) -> Result<String>
Decrypt the provided ciphertext with the given iv, and decodes the result as a utf8 string.
pub fn encrypt_bytes_with_iv(
&self,
cleartext_bytes: &[u8],
iv: &[u8]
) -> Result<(String, String)>
[src]
&self,
cleartext_bytes: &[u8],
iv: &[u8]
) -> Result<(String, String)>
Encrypt using the provided IV.
pub fn encrypt_bytes_rand_iv(
&self,
cleartext_bytes: &[u8]
) -> Result<(String, String, String)>
[src]
&self,
cleartext_bytes: &[u8]
) -> Result<(String, String, String)>
Generate a random iv and encrypt with it. Return both the encrypted bytes and the generated iv.
pub fn encrypt_with_iv(
&self,
cleartext: &str,
iv: &[u8]
) -> Result<(String, String)>
[src]
&self,
cleartext: &str,
iv: &[u8]
) -> Result<(String, String)>
pub fn encrypt_rand_iv(
&self,
cleartext: &str
) -> Result<(String, String, String)>
[src]
&self,
cleartext: &str
) -> Result<(String, String, String)>
Trait Implementations
impl Clone for KeyBundle
[src]
impl Debug for KeyBundle
[src]
impl Eq for KeyBundle
[src]
impl Hash for KeyBundle
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl PartialEq<KeyBundle> for KeyBundle
[src]
impl StructuralEq for KeyBundle
[src]
impl StructuralPartialEq for KeyBundle
[src]
Auto Trait Implementations
impl RefUnwindSafe for KeyBundle
impl Send for KeyBundle
impl Sync for KeyBundle
impl Unpin for KeyBundle
impl UnwindSafe for KeyBundle
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> CallHasher for T where
T: Hash,
T: Hash,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,