pub struct Handover { /* private fields */ }Expand description
What the approving write puts at the request’s path in the request’s place (§13.2). It is one anonymous box with no chunks and no signature: the box authenticates every byte, and the pair it carries proves nothing until the new device’s loading checks it against history.
Implementations§
Source§impl Handover
impl Handover
Sourcepub fn seal(
member: MemberId,
keys: &MemberKeys,
recipient: &SealingKey,
path: &ObjectPath,
) -> Result<Self, CryptoError>
pub fn seal( member: MemberId, keys: &MemberKeys, recipient: &SealingKey, path: &ObjectPath, ) -> Result<Self, CryptoError>
Seal member’s private pair to the sealing key of the request at
path. The bytes are fixed here; a retry of the create repeats them.
Sourcepub fn encode(&self) -> Vec<u8> ⓘ
pub fn encode(&self) -> Vec<u8> ⓘ
The object’s complete bytes: its kind and format, then the box.
Sourcepub fn decode(bytes: &[u8]) -> Result<Self, Error>
pub fn decode(bytes: &[u8]) -> Result<Self, Error>
Read a handover. Bytes of another kind, such as a join request or an
ended pairing’s marker, fail with UnknownTag; one of another length
is truncated or has trailing bytes.
Sourcepub fn open(
&self,
path: &ObjectPath,
asking: &MemberKeys,
) -> Result<(MemberId, MemberKeys), CryptoError>
pub fn open( &self, path: &ObjectPath, asking: &MemberKeys, ) -> Result<(MemberId, MemberKeys), CryptoError>
Open it at path with the pair the request carried the sealing key of.
Returns the member whose pair it is and the pair; the caller requires
the member to be the pairing’s and loading to check the pair.