pub struct EncryptedStash(/* private fields */);Expand description
Encrypted stash stack metadata blob (AAD_STASH).
Contains a CBOR-serialized StashStack struct encrypted with
AES-256-GCM. Written to .void/stash/meta.bin.
Implementations§
Source§impl EncryptedStash
impl EncryptedStash
Sourcepub fn from_bytes(bytes: Vec<u8>) -> Self
pub fn from_bytes(bytes: Vec<u8>) -> Self
Wrap raw ciphertext bytes.
Sourcepub fn into_bytes(self) -> Vec<u8> ⓘ
pub fn into_bytes(self) -> Vec<u8> ⓘ
Consume and return the underlying ciphertext bytes.
Sourcepub fn encrypt(key: &[u8; 32], plaintext: &[u8]) -> CryptoResult<Self>
pub fn encrypt(key: &[u8; 32], plaintext: &[u8]) -> CryptoResult<Self>
Encrypt plaintext with this blob type’s AAD.
Sourcepub fn decrypt(&self, key: &[u8; 32]) -> CryptoResult<Vec<u8>>
pub fn decrypt(&self, key: &[u8; 32]) -> CryptoResult<Vec<u8>>
Decrypt this blob with the correct AAD.
Sourcepub fn decrypt_and_parse<T>(&self, key: &[u8; 32]) -> CryptoResult<T>where
T: DeserializeOwned,
pub fn decrypt_and_parse<T>(&self, key: &[u8; 32]) -> CryptoResult<T>where
T: DeserializeOwned,
Decrypt and parse a CBOR-encoded type with the correct AAD.
Trait Implementations§
Source§impl Debug for EncryptedStash
impl Debug for EncryptedStash
Source§impl EncryptedBlob for EncryptedStash
impl EncryptedBlob for EncryptedStash
Auto Trait Implementations§
impl Freeze for EncryptedStash
impl RefUnwindSafe for EncryptedStash
impl Send for EncryptedStash
impl Sync for EncryptedStash
impl Unpin for EncryptedStash
impl UnsafeUnpin for EncryptedStash
impl UnwindSafe for EncryptedStash
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