[−][src]Struct tcn::ReportAuthorizationKey
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]
&self,
memo_type: MemoType,
memo_data: Vec<u8>,
j_1: u16,
j_2: u16
) -> Result<SignedReport, Error>
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::Read
er.
pub fn write<W: Write>(&self, writer: W) -> Result<(), Error>
[src]
Try to write a ReportAuthorizationKey
into a generic io::Write
er.
Trait Implementations
impl Clone for ReportAuthorizationKey
[src]
fn clone(&self) -> ReportAuthorizationKey
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Copy for ReportAuthorizationKey
[src]
impl Debug for ReportAuthorizationKey
[src]
Auto Trait Implementations
impl RefUnwindSafe for ReportAuthorizationKey
impl Send for ReportAuthorizationKey
impl Sync for ReportAuthorizationKey
impl Unpin for ReportAuthorizationKey
impl UnwindSafe for ReportAuthorizationKey
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,