[][src]Struct tcn::ReportAuthorizationKey

pub struct ReportAuthorizationKey { /* fields omitted */ }

Authorizes publication of a report of potential exposure.

Methods

impl ReportAuthorizationKey[src]

pub fn new<R: RngCore + CryptoRng>(rng: R) -> ReportAuthorizationKey[src]

Initialize a new report authorization key from a random number generator.

pub fn initial_temporary_contact_key(&self) -> TemporaryContactKey[src]

Compute the initial temporary contact key derived from this report authorization key.

Note: this function returns tck_1, the first temporary contact key that can be used to generate tcks.

impl ReportAuthorizationKey[src]

pub fn create_report(
    &self,
    memo_type: MemoType,
    memo_data: Vec<u8>,
    j_1: u16,
    j_2: u16
) -> Result<SignedReport, Error>
[src]

Create a report of potential exposure.

Inputs

  • memo_type, memo_data: the type and data for the report's memo field.
  • j_1 > 0: the ratchet index of the first temporary contact number in the report.
  • j_2: the ratchet index of the last temporary contact number other users should check.

Notes

Creating a report reveals all temporary contact numbers subsequent to j_1, not just up to j_2, which is included for convenience.

The memo_data must be less than 256 bytes long.

Reports are unlinkable from each other only up to the memo field. In other words, adding the same high-entropy data to the memo fields of multiple reports will cause them to be linkable.

impl ReportAuthorizationKey[src]

pub fn read<R: Read>(reader: R) -> Result<ReportAuthorizationKey, Error>[src]

Try to read a ReportAuthorizationKey from a generic io::Reader.

pub fn write<W: Write>(&self, writer: W) -> Result<(), Error>[src]

Try to write a ReportAuthorizationKey into a generic io::Writeer.

Trait Implementations

impl Clone for ReportAuthorizationKey[src]

impl Copy for ReportAuthorizationKey[src]

impl Debug for ReportAuthorizationKey[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.