pub struct EncryptionKeys { /* private fields */ }Expand description
Read and write people’s encryption keys. Cheap to clone.
Implementations§
Source§impl EncryptionKeys
impl EncryptionKeys
Sourcepub fn new(store: Arc<dyn ControlStore>) -> Result<Self>
pub fn new(store: Arc<dyn ControlStore>) -> Result<Self>
Open the document held in store.
Sourcepub fn public_of(&self, principal: &str) -> Result<Option<String>>
pub fn public_of(&self, principal: &str) -> Result<Option<String>>
principal’s public half, or None: what a member wraps a ring to.
Sourcepub fn create(
&self,
principal: &str,
public_key: &str,
first: UnlockMethod,
now_ms: u64,
) -> Result<EncryptionKey>
pub fn create( &self, principal: &str, public_key: &str, first: UnlockMethod, now_ms: u64, ) -> Result<EncryptionKey>
The first time: the public half and the first method. Refused when the person has a key already (a new one would orphan every ring).
Sourcepub fn add_method(
&self,
principal: &str,
method: UnlockMethod,
now_ms: u64,
) -> Result<EncryptionKey>
pub fn add_method( &self, principal: &str, method: UnlockMethod, now_ms: u64, ) -> Result<EncryptionKey>
One more method for principal’s key.
Sourcepub fn remove_method(&self, principal: &str, id: &str) -> Result<EncryptionKey>
pub fn remove_method(&self, principal: &str, id: &str) -> Result<EncryptionKey>
Delete one method’s wrap. The last one is refused.
Trait Implementations§
Source§impl Clone for EncryptionKeys
impl Clone for EncryptionKeys
Auto Trait Implementations§
impl !RefUnwindSafe for EncryptionKeys
impl !UnwindSafe for EncryptionKeys
impl Freeze for EncryptionKeys
impl Send for EncryptionKeys
impl Sync for EncryptionKeys
impl Unpin for EncryptionKeys
impl UnsafeUnpin for EncryptionKeys
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more