Skip to main content

DistributedTranscryptor

Struct DistributedTranscryptor 

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

A distributed PEP transcryptor system that extends super::types::Transcryptor with blinding factor support for generating session key shares in a distributed transcryptor setup.

All methods from super::types::Transcryptor are directly accessible via Deref.

Implementations§

Source§

impl DistributedTranscryptor

Source

pub fn new( pseudonymisation_secret: PseudonymizationSecret, rekeying_secret: EncryptionSecret, blinding_factor: BlindingFactor, ) -> Self

Create a new distributed PEP system with the given secrets and blinding factor.

Source

pub fn system(&self) -> &Transcryptor

Get a reference to the underlying PEP system.

Source

pub fn pseudonym_session_key_share( &self, session: &EncryptionContext, ) -> PseudonymSessionKeyShare

Generate a pseudonym session key share for the given session.

Source

pub fn attribute_session_key_share( &self, session: &EncryptionContext, ) -> AttributeSessionKeyShare

Generate an attribute session key share for the given session.

Source

pub fn session_key_shares( &self, session: &EncryptionContext, ) -> SessionKeyShares

Generate both pseudonym and attribute session key shares for the given session. This is a convenience method that returns both shares together.

Methods from Deref<Target = Transcryptor>§

Source

pub fn attribute_rekey_info( &self, session_from: &EncryptionContext, session_to: &EncryptionContext, ) -> AttributeRekeyInfo

Generate an attribute rekey info to rekey attributes from a given EncryptionContext to another.

Source

pub fn pseudonym_rekey_info( &self, session_from: &EncryptionContext, session_to: &EncryptionContext, ) -> PseudonymRekeyInfo

Generate a pseudonym rekey info to rekey pseudonyms from a given EncryptionContext to another.

Source

pub fn pseudonymization_info( &self, domain_from: &PseudonymizationDomain, domain_to: &PseudonymizationDomain, session_from: &EncryptionContext, session_to: &EncryptionContext, ) -> PseudonymizationInfo

Generate a pseudonymization info to pseudonymize from a given PseudonymizationDomain and EncryptionContext to another.

Source

pub fn transcryption_info( &self, domain_from: &PseudonymizationDomain, domain_to: &PseudonymizationDomain, session_from: &EncryptionContext, session_to: &EncryptionContext, ) -> TranscryptionInfo

Generate a transcryption info to transcrypt from a given PseudonymizationDomain and EncryptionContext to another.

Source

pub fn rekey<E>(&self, encrypted: &E, rekey_info: &E::RekeyInfo) -> E
where E: Rekeyable,

Rekey encrypted data from one session to another. Automatically works with any rekeyable type (attributes, long attributes, etc.)

Source

pub fn pseudonymize<E>( &self, encrypted: &E, pseudonymization_info: &PseudonymizationInfo, ) -> E
where E: Pseudonymizable,

Pseudonymize encrypted data from one domain/session to another. Automatically works with any pseudonymizable type (pseudonyms, long pseudonyms, etc.)

Source

pub fn transcrypt<E>( &self, encrypted: &E, transcryption_info: &TranscryptionInfo, ) -> E
where E: Transcryptable,

Transcrypt (rekey or pseudonymize) encrypted data from one domain/session to another. Automatically works with any transcryptable type (pseudonyms, attributes, JSON values, records, etc.)

Source

pub fn rekey_batch<E, R>( &self, encrypted: &mut [E], rekey_info: &E::RekeyInfo, rng: &mut R, ) -> Result<Box<[E]>, BatchError>

Rekey a batch of encrypted data from one session to another. Automatically works with any rekeyable type (attributes, long attributes, etc.)

§Errors

Returns an error if the encrypted data do not all have the same structure.

Source

pub fn pseudonymize_batch<E, R>( &self, encrypted: &mut [E], pseudonymization_info: &PseudonymizationInfo, rng: &mut R, ) -> Result<Box<[E]>, BatchError>

Pseudonymize a batch of encrypted data from one domain/session to another. Automatically works with any pseudonymizable type (pseudonyms, long pseudonyms, etc.)

§Errors

Returns an error if the encrypted data do not all have the same structure.

Source

pub fn transcrypt_batch<E, R>( &self, encrypted: &mut [E], transcryption_info: &TranscryptionInfo, rng: &mut R, ) -> Result<Box<[E]>, BatchError>

Transcrypt a batch of encrypted data from one domain/session to another. Automatically works with any transcryptable type (records, JSON values, long records, etc.)

§Errors

Returns an error if the encrypted data do not all have the same structure.

Trait Implementations§

Source§

impl Clone for DistributedTranscryptor

Source§

fn clone(&self) -> DistributedTranscryptor

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Deref for DistributedTranscryptor

Source§

type Target = Transcryptor

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.

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
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
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<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.