pub struct MailKeyring { /* private fields */ }Expand description
Retained verified cards and their secrets, by card hash, through receive_until.
Implementations§
Source§impl MailKeyring
impl MailKeyring
pub fn new(owner: AgentId) -> Self
pub fn owner(&self) -> &AgentId
pub fn add(&mut self, card: &MailboxCard, key: MailEncryptionKey) -> Result<()>
Sourcepub fn open(&self, packet: &Packet, now: i64) -> Result<MessagePayload>
pub fn open(&self, packet: &Packet, now: i64) -> Result<MessagePayload>
Verify and decrypt a packet with the retained card it names; cards were verified at add.
Sourcepub fn prune(&mut self, now: i64) -> Result<()>
pub fn prune(&mut self, now: i64) -> Result<()>
Only keys past the signed receive_until are removed. This cannot erase
copies held in snapshots or backups, which the application must manage.
Sourcepub fn snapshot(&self) -> Result<Value>
pub fn snapshot(&self) -> Result<Value>
SENSITIVE: includes decryption keys. Protect this output at rest; never pass it to a relay or log it.
pub fn from_snapshot(value: &Value) -> Result<Self>
Auto Trait Implementations§
impl Freeze for MailKeyring
impl RefUnwindSafe for MailKeyring
impl Send for MailKeyring
impl Sync for MailKeyring
impl Unpin for MailKeyring
impl UnsafeUnpin for MailKeyring
impl UnwindSafe for MailKeyring
Blanket Implementations§
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