pub struct PairingCode {
pub store: StoreId,
pub expires_at: u64,
pub pairing: InviteId,
pub member: MemberId,
pub secret: InviteSecret,
pub showing: DeviceId,
pub storage: SecretBytes,
}Expand description
A pairing code: what the person’s new device needs to find the store and to send a request its showing device can open. It holds no keys (§13.2, D13).
Fields§
§store: StoreIdThe store’s id.
expires_at: u64When the pairing ends, in seconds since the Unix epoch by the showing device’s clock: the asking device sends no first request after it.
pairing: InviteIdThe pairing named by the request’s path, in an invite’s place.
member: MemberIdThe showing device’s member, whose pair the handover carries. The signed request must repeat it.
secret: InviteSecretCrypto owns the one-time secret and its erasure.
showing: DeviceIdThe device that made the pairing, under whose id the request goes.
storage: SecretBytesThe store’s location, and on S3 the key the showing device connects with where the code is the QR code.
Implementations§
Source§impl PairingCode
impl PairingCode
Sourcepub const TEXT_PREFIX: &'static str = "CVP1-"
pub const TEXT_PREFIX: &'static str = "CVP1-"
How a pairing code’s text starts: its kind and version.
Sourcepub fn request_path(&self) -> ObjectPath
pub fn request_path(&self) -> ObjectPath
Where the asking device’s request goes: under the showing device, as this code names it (§13.2).
Sourcepub fn to_bytes(&self) -> Result<Zeroizing<Vec<u8>>, Error>
pub fn to_bytes(&self) -> Result<Zeroizing<Vec<u8>>, Error>
Encode a bounded frame into a buffer erased on drop, allocated once.
Sourcepub fn from_bytes(bytes: &[u8]) -> Result<Self, Error>
pub fn from_bytes(bytes: &[u8]) -> Result<Self, Error>
Decode a borrowed frame; every owned secret buffer erases on drop.