Struct holochain::prelude::kitsune_p2p::dependencies::kitsune_p2p_types::dependencies::lair_keystore_api::lair_client::LairClient
pub struct LairClient(pub Arc<dyn AsLairClient + 'static>);
Expand description
A lair keystore client handle. Use this to make requests of the keystore.
Tuple Fields
0: Arc<dyn AsLairClient + 'static>
Implementations
impl LairClient
impl LairClient
pub fn get_enc_ctx_key(&self) -> BufReadSized<32>
pub fn get_enc_ctx_key(&self) -> BufReadSized<32>
Return the encryption context key for passphrases, etc.
pub fn get_dec_ctx_key(&self) -> BufReadSized<32>
pub fn get_dec_ctx_key(&self) -> BufReadSized<32>
Return the decryption context key for passphrases, etc.
pub fn shutdown(
&self
) -> impl Future<Output = Result<(), OneErr>> + Send + 'static
pub fn shutdown(
&self
) -> impl Future<Output = Result<(), OneErr>> + Send + 'static
Shutdown the client connection.
pub fn request<R>(
&self,
request: R
) -> impl Future<Output = Result<<R as AsLairRequest>::Response, OneErr>> + Send + 'staticwhere
R: AsLairRequest,
OneErr: From<<<R as AsLairRequest>::Response as TryFrom<LairApiEnum>>::Error>,
pub fn request<R>(
&self,
request: R
) -> impl Future<Output = Result<<R as AsLairRequest>::Response, OneErr>> + Send + 'staticwhere
R: AsLairRequest,
OneErr: From<<<R as AsLairRequest>::Response as TryFrom<LairApiEnum>>::Error>,
Handle a generic lair client request.
pub fn hello(
&self,
expected_server_pub_key: BinDataSized<32>
) -> impl Future<Output = Result<Arc<str>, OneErr>> + Send + 'static
pub fn hello(
&self,
expected_server_pub_key: BinDataSized<32>
) -> impl Future<Output = Result<Arc<str>, OneErr>> + Send + 'static
Send the hello message to establish server authenticity. Check with your implementation before invoking this… it likely handles this for you in its constructor.
pub fn unlock(
&self,
passphrase: BufRead
) -> impl Future<Output = Result<(), OneErr>> + Send + 'static
pub fn unlock(
&self,
passphrase: BufRead
) -> impl Future<Output = Result<(), OneErr>> + Send + 'static
Send the unlock request to unlock / communicate with the server. (this verifies client authenticity) Check with your implementation before invoking this… it likely handles this for you in its constructor.
pub fn list_entries(
&self
) -> impl Future<Output = Result<Vec<LairEntryInfo, Global>, OneErr>> + Send + 'static
pub fn list_entries(
&self
) -> impl Future<Output = Result<Vec<LairEntryInfo, Global>, OneErr>> + Send + 'static
Request a list of entries from lair.
pub fn get_entry(
&self,
tag: Arc<str>
) -> impl Future<Output = Result<LairEntryInfo, OneErr>> + Send + 'static
pub fn get_entry(
&self,
tag: Arc<str>
) -> impl Future<Output = Result<LairEntryInfo, OneErr>> + Send + 'static
Return the EntryInfo for a given tag, or error if no such tag.
pub fn new_seed(
&self,
tag: Arc<str>,
deep_lock_passphrase: Option<BufRead>,
exportable: bool
) -> impl Future<Output = Result<SeedInfo, OneErr>> + Send + 'static
pub fn new_seed(
&self,
tag: Arc<str>,
deep_lock_passphrase: Option<BufRead>,
exportable: bool
) -> impl Future<Output = Result<SeedInfo, OneErr>> + Send + 'static
Instruct lair to generate a new seed from cryptographically secure random data with given tag. If the seed should be deeply locked, supply the deep_lock_passphrase as well. Respects hc_seed_bundle::PwHashLimits.
pub fn export_seed_by_tag(
&self,
tag: Arc<str>,
sender_pub_key: BinDataSized<32>,
recipient_pub_key: BinDataSized<32>,
deep_lock_passphrase: Option<BufRead>
) -> impl Future<Output = Result<([u8; 24], Arc<[u8]>), OneErr>> + Send + 'static
pub fn export_seed_by_tag(
&self,
tag: Arc<str>,
sender_pub_key: BinDataSized<32>,
recipient_pub_key: BinDataSized<32>,
deep_lock_passphrase: Option<BufRead>
) -> impl Future<Output = Result<([u8; 24], Arc<[u8]>), OneErr>> + Send + 'static
Export seeds (that are marked “exportable”) by using the x25519xsalsa20poly1305 “crypto_box” algorithm. Respects hc_seed_bundle::PwHashLimits.
pub fn import_seed(
&self,
sender_pub_key: BinDataSized<32>,
recipient_pub_key: BinDataSized<32>,
deep_lock_passphrase: Option<BufRead>,
nonce: [u8; 24],
cipher: Arc<[u8]>,
tag: Arc<str>,
exportable: bool
) -> impl Future<Output = Result<SeedInfo, OneErr>> + Send + 'static
pub fn import_seed(
&self,
sender_pub_key: BinDataSized<32>,
recipient_pub_key: BinDataSized<32>,
deep_lock_passphrase: Option<BufRead>,
nonce: [u8; 24],
cipher: Arc<[u8]>,
tag: Arc<str>,
exportable: bool
) -> impl Future<Output = Result<SeedInfo, OneErr>> + Send + 'static
Import a seed encrypted via x25519xsalsa20poly1305 secretbox. Note it is 100% valid to co-opt this function to allow importing seeds that have been generated via custom algorithms, but you take responsibility for those security concerns. Respects hc_seed_bundle::PwHashLimits.
pub fn derive_seed(
&self,
_src_tag: Arc<str>,
_src_deep_lock_passphrase: Option<BufRead>,
_dst_tag: Arc<str>,
_dst_deep_lock_passphrase: Option<BufRead>,
_derivation: Box<[u32], Global>
) -> impl Future<Output = Result<SeedInfo, OneErr>> + Send + 'static
pub fn derive_seed(
&self,
_src_tag: Arc<str>,
_src_deep_lock_passphrase: Option<BufRead>,
_dst_tag: Arc<str>,
_dst_deep_lock_passphrase: Option<BufRead>,
_derivation: Box<[u32], Global>
) -> impl Future<Output = Result<SeedInfo, OneErr>> + Send + 'static
Derive a pre-existing key identified by given src_tag, with given derivation path, storing the final resulting sub-seed with the given dst_tag.
pub fn sign_by_pub_key(
&self,
pub_key: BinDataSized<32>,
deep_lock_passphrase: Option<BufRead>,
data: Arc<[u8]>
) -> impl Future<Output = Result<BinDataSized<64>, OneErr>> + Send + 'static
pub fn sign_by_pub_key(
&self,
pub_key: BinDataSized<32>,
deep_lock_passphrase: Option<BufRead>,
data: Arc<[u8]>
) -> impl Future<Output = Result<BinDataSized<64>, OneErr>> + Send + 'static
Generate a signature for given data, with the ed25519 keypair derived from seed identified by the given ed25519 pubkey. Respects hc_seed_bundle::PwHashLimits.
pub fn crypto_box_xsalsa_by_pub_key(
&self,
sender_pub_key: BinDataSized<32>,
recipient_pub_key: BinDataSized<32>,
deep_lock_passphrase: Option<BufRead>,
data: Arc<[u8]>
) -> impl Future<Output = Result<([u8; 24], Arc<[u8]>), OneErr>> + Send + 'static
pub fn crypto_box_xsalsa_by_pub_key(
&self,
sender_pub_key: BinDataSized<32>,
recipient_pub_key: BinDataSized<32>,
deep_lock_passphrase: Option<BufRead>,
data: Arc<[u8]>
) -> impl Future<Output = Result<([u8; 24], Arc<[u8]>), OneErr>> + Send + 'static
Encrypt data for a target recipient using the x25519xsalsa20poly1305 “crypto_box” algorithm. Respects hc_seed_bundle::PwHashLimits.
pub fn crypto_box_xsalsa_open_by_pub_key(
&self,
sender_pub_key: BinDataSized<32>,
recipient_pub_key: BinDataSized<32>,
deep_lock_passphrase: Option<BufRead>,
nonce: [u8; 24],
cipher: Arc<[u8]>
) -> impl Future<Output = Result<Arc<[u8]>, OneErr>> + Send + 'static
pub fn crypto_box_xsalsa_open_by_pub_key(
&self,
sender_pub_key: BinDataSized<32>,
recipient_pub_key: BinDataSized<32>,
deep_lock_passphrase: Option<BufRead>,
nonce: [u8; 24],
cipher: Arc<[u8]>
) -> impl Future<Output = Result<Arc<[u8]>, OneErr>> + Send + 'static
Decrypt data from a target sender using the x25519xsalsa20poly1305 “crypto_box_open” algorithm. Respects hc_seed_bundle::PwHashLimits.
pub fn new_wka_tls_cert(
&self,
tag: Arc<str>
) -> impl Future<Output = Result<CertInfo, OneErr>> + Send + 'static
pub fn new_wka_tls_cert(
&self,
tag: Arc<str>
) -> impl Future<Output = Result<CertInfo, OneErr>> + Send + 'static
Instruct lair to generate a new well-known-authority signed TLS cert. This is a lot like a self-signed certificate, but slightly easier to work with in that it allows registering a single well-known-authority as a certificate authority which will respect multiple certs.
pub fn get_wka_tls_cert_priv_key(
&self,
tag: Arc<str>
) -> impl Future<Output = Result<BufRead, OneErr>> + Send + 'static
pub fn get_wka_tls_cert_priv_key(
&self,
tag: Arc<str>
) -> impl Future<Output = Result<BufRead, OneErr>> + Send + 'static
Fetch the private key associated with a wka_tls_cert entry. Will error if the entry specified by ‘tag’ is not a wka_tls_cert.
pub fn secretbox_xsalsa_by_tag(
&self,
tag: Arc<str>,
deep_lock_passphrase: Option<BufRead>,
data: Arc<[u8]>
) -> impl Future<Output = Result<([u8; 24], Arc<[u8]>), OneErr>> + Send + 'static
pub fn secretbox_xsalsa_by_tag(
&self,
tag: Arc<str>,
deep_lock_passphrase: Option<BufRead>,
data: Arc<[u8]>
) -> impl Future<Output = Result<([u8; 24], Arc<[u8]>), OneErr>> + Send + 'static
Shared secret encryption using the libsodium xsalsa20poly1305 “secretbox” algorithm. Respects hc_seed_bundle::PwHashLimits.
pub fn secretbox_xsalsa_open_by_tag(
&self,
tag: Arc<str>,
deep_lock_passphrase: Option<BufRead>,
nonce: [u8; 24],
cipher: Arc<[u8]>
) -> impl Future<Output = Result<Arc<[u8]>, OneErr>> + Send + 'static
pub fn secretbox_xsalsa_open_by_tag(
&self,
tag: Arc<str>,
deep_lock_passphrase: Option<BufRead>,
nonce: [u8; 24],
cipher: Arc<[u8]>
) -> impl Future<Output = Result<Arc<[u8]>, OneErr>> + Send + 'static
Shared secret decryption using the libsodium xsalsa20poly1305 “secretbox_open” algorithm. Respects hc_seed_bundle::PwHashLimits.
Trait Implementations
impl Clone for LairClient
impl Clone for LairClient
fn clone(&self) -> LairClient
fn clone(&self) -> LairClient
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreAuto Trait Implementations
impl !RefUnwindSafe for LairClient
impl Send for LairClient
impl Sync for LairClient
impl Unpin for LairClient
impl !UnwindSafe for LairClient
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
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
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> ⓘ
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
sourcefn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
sourcefn 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 morefn 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.