pub struct UnlockedSeedBundle { /* private fields */ }
Expand description
This is the main struct for interacting with SeedBundles.
To create an UnlockedSeedBundle:
- A new random bundle: UnlockedSeedBundle::new_random
- Derived from an existing bundle: UnlockedSeedBundle::derive
- Unlock encrypted bundle bytes: UnlockedSeedBundle::from_locked
Once unlocked, you can get or set associated app data, or sign messages.
To “lock” (generate encrypted binary seed bundle representation), use UnlockedSeedBundle::lock and supply the desired SeedCiphers.
Implementations
impl UnlockedSeedBundle
impl UnlockedSeedBundle
pub async fn new_random() -> Result<UnlockedSeedBundle, OneErr>
pub async fn new_random() -> Result<UnlockedSeedBundle, OneErr>
Construct a new random seed SeedBundle.
pub async fn from_locked(
bytes: &'_ [u8]
) -> Result<Vec<LockedSeedCipher, Global>, OneErr>
pub async fn from_locked(
bytes: &'_ [u8]
) -> Result<Vec<LockedSeedCipher, Global>, OneErr>
Decode locked SeedBundle bytes into a list of LockedSeedCiphers to be used for decrypting the bundle.
pub fn get_seed(&self) -> BufReadSized<32_usize>
pub fn get_seed(&self) -> BufReadSized<32_usize>
Get the actual seed tracked by this seed bundle.
pub fn derive(
&self,
index: u32
) -> impl Future<Output = Result<UnlockedSeedBundle, OneErr>> + Send + 'static
pub fn derive(
&self,
index: u32
) -> impl Future<Output = Result<UnlockedSeedBundle, OneErr>> + Send + 'static
Derive a new sub SeedBundle by given index.
pub fn get_sign_pub_key(&self) -> BufReadSized<{_: usize}>
pub fn get_sign_pub_key(&self) -> BufReadSized<{_: usize}>
Get the signature pub key generated by this seed.
pub fn sign_detached<M>(
&self,
message: M
) -> impl Future<Output = Result<BufReadSized<{_: usize}>, OneErr>> + Send + 'static where
M: 'static + Into<BufRead> + Send,
pub fn sign_detached<M>(
&self,
message: M
) -> impl Future<Output = Result<BufReadSized<{_: usize}>, OneErr>> + Send + 'static where
M: 'static + Into<BufRead> + Send,
Sign some data with the secret key generated by this seed.
pub fn get_app_data_bytes(&self) -> &[u8]ⓘNotable traits for &'_ mut [u8]impl<'_> Write for &'_ mut [u8]impl<'_> Read for &'_ [u8]
pub fn get_app_data_bytes(&self) -> &[u8]ⓘNotable traits for &'_ mut [u8]impl<'_> Write for &'_ mut [u8]impl<'_> Read for &'_ [u8]
Get the raw appData bytes.
pub fn set_app_data_bytes<B>(&mut self, app_data: B) where
B: Into<Arc<[u8]>>,
pub fn set_app_data_bytes<B>(&mut self, app_data: B) where
B: Into<Arc<[u8]>>,
Set the raw appData bytes.
pub fn get_app_data<T>(&self) -> Result<T, OneErr> where
T: 'static + for<'de> Deserialize<'de>,
pub fn get_app_data<T>(&self) -> Result<T, OneErr> where
T: 'static + for<'de> Deserialize<'de>,
Get the decoded appData bytes by type.
pub fn set_app_data<T>(&mut self, t: &T) -> Result<(), OneErr> where
T: Serialize,
pub fn set_app_data<T>(&mut self, t: &T) -> Result<(), OneErr> where
T: Serialize,
Set the encoded appData bytes by type.
pub fn lock(&self) -> SeedCipherBuilder
pub fn lock(&self) -> SeedCipherBuilder
Get a SeedCipherBuilder that will allow us to lock this bundle.
Trait Implementations
impl Clone for UnlockedSeedBundle
impl Clone for UnlockedSeedBundle
fn clone(&self) -> UnlockedSeedBundle
fn clone(&self) -> UnlockedSeedBundle
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
Auto Trait Implementations
impl !RefUnwindSafe for UnlockedSeedBundle
impl Send for UnlockedSeedBundle
impl Sync for UnlockedSeedBundle
impl Unpin for UnlockedSeedBundle
impl !UnwindSafe for UnlockedSeedBundle
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
fn instrument(self, span: Span) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
T: Future, type Output = <T as Future>::Output;
sourcefn in_current_span(self) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
fn in_current_span(self) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
T: Future, type Output = <T as Future>::Output;
impl<T> Pointable for T
impl<T> Pointable for T
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>ⓘNotable traits for WithDispatch<T>impl<T> Future for WithDispatch<T> where
T: Future, type Output = <T as Future>::Output;
where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>ⓘNotable traits for WithDispatch<T>impl<T> Future for WithDispatch<T> where
T: Future, type Output = <T as Future>::Output;
where
S: Into<Dispatch>,
T: Future, type Output = <T as Future>::Output;
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>ⓘNotable traits for WithDispatch<T>impl<T> Future for WithDispatch<T> where
T: Future, type Output = <T as Future>::Output;
fn with_current_subscriber(self) -> WithDispatch<Self>ⓘNotable traits for WithDispatch<T>impl<T> Future for WithDispatch<T> where
T: Future, type Output = <T as Future>::Output;
T: Future, type Output = <T as Future>::Output;
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more