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§
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more