Struct dittolive_ditto::identity::SharedKey
source · [−]pub struct SharedKey { /* private fields */ }
Expand description
An identity where any device is trusted provided they know the secret key. This is a simplistic authentication model normally only suitable for private apps where users and devices are both trusted. In this mode, any string may be used as the app id.
Implementations
sourcepub fn new(
_ditto_root: Arc<dyn DittoRoot>,
app_id: AppId,
key_der_b64: &str
) -> Result<Self, DittoError>
pub fn new(
_ditto_root: Arc<dyn DittoRoot>,
app_id: AppId,
key_der_b64: &str
) -> Result<Self, DittoError>
Construct a SharedKey
identity.
ditto_root
: An instance ofDittoRoot
for local storageapp_id
: The unique UUIDv4 identifying this app; must be shared across all instanceskey_der_b64
: A pre-shared key for securing peer-to-peer communication encoded as a Base64 string
Auto Trait Implementations
Blanket Implementations
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
fn compat_ref(&self) -> Compat<&T>
fn compat_ref(&self) -> Compat<&T>
Applies the [
Compat
] adapter by shared reference. Read morefn compat_mut(&mut self) -> Compat<&mut T>
fn compat_mut(&mut self) -> Compat<&mut T>
Applies the [
Compat
] adapter by mutable reference. Read more