pub struct RestoreCode {
pub store: StoreId,
pub member: MemberId,
pub member_keys: MemberKeys,
pub storage: SecretBytes,
}Expand description
A person’s keys and the store’s identity and location (§13.1).
Fields§
§store: StoreIdThe store’s id.
member: MemberIdThe stable member the private pair belongs to. Restore requires this id’s current pair; an old code cannot rebind it (D13).
member_keys: MemberKeysCrypto owns both member key pairs, their encoding and erasure.
storage: SecretBytesStorage location only, interpreted by storage; never credentials.
Implementations§
Source§impl RestoreCode
impl RestoreCode
Sourcepub const TEXT_PREFIX: &'static str = "CVR1-"
pub const TEXT_PREFIX: &'static str = "CVR1-"
How a restore code’s text starts: its kind and version.
Sourcepub fn to_bytes(&self) -> Result<Zeroizing<Vec<u8>>, Error>
pub fn to_bytes(&self) -> Result<Zeroizing<Vec<u8>>, Error>
Encode a bounded frame into a buffer erased on drop, allocated once.
Sourcepub fn from_bytes(bytes: &[u8]) -> Result<Self, Error>
pub fn from_bytes(bytes: &[u8]) -> Result<Self, Error>
Decode a borrowed frame; every owned copy of private material erases on drop.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for RestoreCode
impl RefUnwindSafe for RestoreCode
impl Send for RestoreCode
impl Sync for RestoreCode
impl Unpin for RestoreCode
impl UnsafeUnpin for RestoreCode
impl UnwindSafe for RestoreCode
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