pub struct EncryptedBlob(/* private fields */);Expand description
Opaque encrypted blob: nonce (12 B) || ciphertext+tag.
Implementations§
Source§impl EncryptedBlob
impl EncryptedBlob
Sourcepub fn seal(key: &VaultKey, plaintext: &[u8]) -> Result<Self, VaultError>
pub fn seal(key: &VaultKey, plaintext: &[u8]) -> Result<Self, VaultError>
Encrypt plaintext under key with a fresh random nonce.
Sourcepub fn as_bytes(&self) -> &[u8] ⓘ
pub fn as_bytes(&self) -> &[u8] ⓘ
Raw bytes (nonce + ciphertext + tag) — useful for uniqueness checks.
Sourcepub fn nonce_bytes(&self) -> &[u8] ⓘ
pub fn nonce_bytes(&self) -> &[u8] ⓘ
Nonce portion (first 12 bytes).
Trait Implementations§
Source§impl Clone for EncryptedBlob
impl Clone for EncryptedBlob
Source§fn clone(&self) -> EncryptedBlob
fn clone(&self) -> EncryptedBlob
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 EncryptedBlob
impl Debug for EncryptedBlob
Source§impl<'de> Deserialize<'de> for EncryptedBlob
impl<'de> Deserialize<'de> for EncryptedBlob
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
Auto Trait Implementations§
impl Freeze for EncryptedBlob
impl RefUnwindSafe for EncryptedBlob
impl Send for EncryptedBlob
impl Sync for EncryptedBlob
impl Unpin for EncryptedBlob
impl UnsafeUnpin for EncryptedBlob
impl UnwindSafe for EncryptedBlob
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