pub enum Multibox {
PrivateBox(Vec<u8>),
Other(u64, Vec<u8>),
}Expand description
A multibox that owns its data. This does no decryption, it stores cyphertext.
Variants§
Implementations§
Source§impl Multibox
impl Multibox
Sourcepub fn new_private_box(secret: Vec<u8>) -> Multibox
pub fn new_private_box(secret: Vec<u8>) -> Multibox
Creates a new private box multibox with the given secret text (not base64 encoded).
Sourcepub fn new_multibox(id: u64, secret: Vec<u8>) -> Multibox
pub fn new_multibox(id: u64, secret: Vec<u8>) -> Multibox
Creates a multibox with the given identifier and the given secret text (not base64 encoded).
Sourcepub fn from_legacy(s: &[u8]) -> Result<(Multibox, &[u8]), DecodeLegacyError>
pub fn from_legacy(s: &[u8]) -> Result<(Multibox, &[u8]), DecodeLegacyError>
Parses a
legacy encoding
into a Multibox, also returning the remaining input on success.
Sourcepub fn to_legacy<W: Write>(&self, w: &mut W) -> Result<(), Error>
pub fn to_legacy<W: Write>(&self, w: &mut W) -> Result<(), Error>
Serialize a Multibox into a writer, using the
legacy encoding.
Sourcepub fn to_legacy_vec(&self) -> Vec<u8> ⓘ
pub fn to_legacy_vec(&self) -> Vec<u8> ⓘ
Serialize a Multibox into an owned byte vector, using the
legacy encoding.
Sourcepub fn to_legacy_string(&self) -> String
pub fn to_legacy_string(&self) -> String
Serialize a Multibox into an owned string, using the
legacy encoding.
Trait Implementations§
Source§impl Ord for Multibox
impl Ord for Multibox
Source§impl PartialOrd for Multibox
impl PartialOrd for Multibox
impl Eq for Multibox
impl StructuralPartialEq for Multibox
Auto Trait Implementations§
impl Freeze for Multibox
impl RefUnwindSafe for Multibox
impl Send for Multibox
impl Sync for Multibox
impl Unpin for Multibox
impl UnwindSafe for Multibox
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