Skip to main content

Journalist

Struct Journalist 

Source
pub struct Journalist { /* private fields */ }
Expand description

Journalists: ingredients. Journalists have a signing/verifying key, a reply key, a fetch key, and a collection of one-time signed key bundles

Implementations§

Source§

impl Journalist

Source

pub fn new<R: RngCore + CryptoRng>(rng: &mut R, num_keybundles: usize) -> Self

Source

pub fn public(&self, idx: usize) -> JournalistPublicView

Trait Implementations§

Source§

impl Api for Journalist

Source§

fn newsroom_verifying_key(&self) -> Option<&VerifyingKey>

Returns the stored newsroom verifying key, if one has been verified.
Source§

fn set_newsroom_verifying_key(&mut self, key: VerifyingKey)

Stores a verified newsroom verifying key.
Source§

fn fetch_newsroom_keys(&self) -> SourceNewsroomKeyRequest

Creates a request to fetch the newsroom’s public keys from the server. Read more
Source§

fn fetch_journalist_keys(&self) -> SourceJournalistKeyRequest

Creates a request to fetch journalist public keys from the server. Read more
Source§

fn fetch_message_ids<R: RngCore + CryptoRng>( &self, _rng: &mut R, ) -> MessageChallengeFetchRequest

Creates a request to fetch encrypted message IDs from the server. Read more
Source§

fn solve_fetch_challenges( &self, challenges: &[FetchResponse], ) -> Result<Vec<Uuid>, Error>
where Self: Sized + UserSecret,

Solves the encrypted message-ID challenges returned by the server. Read more
Source§

fn fetch_message(&self, message_id: Uuid) -> Option<MessageFetchRequest>

Creates a request to fetch a specific message by its ID. Read more
Source§

fn submit_message<R, S, P>( &self, rng: &mut R, message: &[u8], sender: &S, recipient: &P, ) -> Result<Envelope, Error>

Encrypts and submits a message from sender to recipient. Read more
Source§

fn handle_newsroom_key_response( &mut self, response: &SourceNewsroomKeyResponse, fpf_verifying_key: &VerifyingKey, ) -> Result<(), Error>

Verifies and stores the newsroom’s verifying key from a server response. Read more
Source§

fn handle_journalist_key_response( &self, response: &SourceJournalistKeyResponse, newsroom_verifying_key: &VerifyingKey, ) -> Result<(), Error>

Verifies a journalist’s key response against the newsroom’s signature. Read more
Source§

impl Enrollable for Journalist

Source§

fn enroll(&self) -> Enrollment

Source§

fn signed_keybundles(&self) -> Vec<SignedKeyBundlePublic>

Each item is a SignedKeyBundlePublic: the public keys together with the journalist’s self-signature over them.
Source§

fn signing_key(&self) -> &VerifyingKey

Source§

impl UserSecret for Journalist

Private, common to all users, implemented for Journalists

Source§

fn num_bundles(&self) -> usize

Source§

fn fetch_keypair(&self) -> (&DHPrivateKey, &DHPublicKey)

Source§

fn message_auth_key(&self) -> &MessagePrivateKey

The long-term SD-APKE private key sk^APKE.
Source§

fn message_auth_pk(&self) -> &MessagePublicKey

The long-term SD-APKE public key pk^APKE.
Source§

fn build_message(&self, message: Vec<u8>) -> Plaintext

Source§

fn keybundles(&self) -> Vec<&MessageKeyBundle>

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> Classify for T

§

type Classified = T

§

fn classify(self) -> T

§

impl<T> Classify for T

§

type Classified = T

§

fn classify(self) -> T

§

impl<T> Declassify for T

§

type Declassified = T

§

fn declassify(self) -> T

§

impl<T> Declassify for T

§

type Declassified = T

§

fn declassify(self) -> T

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> JournalistApi for T
where T: Api + Enrollable + RestrictedApi,

Source§

fn create_setup_request(&self) -> Result<JournalistSetupRequest, Error>

Creates an enrollment request for initial journalist onboarding. Read more
Source§

fn create_ephemeral_key_request(&self) -> JournalistEphemeralKeyRequest

Creates a request to replenish ephemeral key bundles on the server. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V