Struct holochain::prelude::kitsune_p2p::dependencies::kitsune_p2p_types::dependencies::lair_keystore_api::dependencies::hc_seed_bundle::UnlockedSeedBundle
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(
) -> impl Future<Output = Result<UnlockedSeedBundle, OneErr>>
pub async fn new_random(
) -> impl Future<Output = Result<UnlockedSeedBundle, OneErr>>
Construct a new random seed SeedBundle.
pub async fn from_locked(
bytes: &[u8]
) -> impl Future<Output = Result<Vec<LockedSeedCipher, Global>, OneErr>>
pub async fn from_locked(
bytes: &[u8]
) -> impl Future<Output = 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>
pub fn get_seed(&self) -> BufReadSized<32>
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<_>
pub fn get_sign_pub_key(&self) -> BufReadSized<_>
Get the signature pub key generated by this seed.
pub fn sign_detached<M>(
&self,
message: M
) -> impl Future<Output = Result<BufReadSized<_>, OneErr>> + Send + 'staticwhere
M: 'static + Into<BufRead> + Send,
pub fn sign_detached<M>(
&self,
message: M
) -> impl Future<Output = Result<BufReadSized<_>, OneErr>> + Send + 'staticwhere
M: 'static + Into<BufRead> + Send,
Sign some data with the secret key generated by this seed.
pub fn get_app_data_bytes(&self) -> &[u8] ⓘ
pub fn get_app_data_bytes(&self) -> &[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
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for UnlockedSeedBundle
impl Send for UnlockedSeedBundle
impl Sync for UnlockedSeedBundle
impl Unpin for UnlockedSeedBundle
impl !UnwindSafe for UnlockedSeedBundle
Blanket Implementations§
§impl<T> Any for Twhere
T: Any + ?Sized,
impl<T> Any for Twhere
T: Any + ?Sized,
§fn type_id_compat(&self) -> TypeId
fn type_id_compat(&self) -> TypeId
§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata
) -> <T as Pointee>::Metadata
fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata
) -> <T as Pointee>::Metadata
§impl<F, W, T, D> Deserialize<With<T, W>, D> for Fwhere
W: DeserializeWith<F, T, D>,
D: Fallible + ?Sized,
F: ?Sized,
impl<F, W, T, D> Deserialize<With<T, W>, D> for Fwhere
W: DeserializeWith<F, T, D>,
D: Fallible + ?Sized,
F: ?Sized,
§fn deserialize(
&self,
deserializer: &mut D
) -> Result<With<T, W>, <D as Fallible>::Error>
fn deserialize(
&self,
deserializer: &mut D
) -> Result<With<T, W>, <D as Fallible>::Error>
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self
from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self
is actually part of its subset T
(and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset
but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self
to the equivalent element of its superset.