[][src]Struct sss_rs::sharer::Sharer

pub struct Sharer { /* fields omitted */ }

Creates shares from a given secret. Shares to any suitable destination that implements Write and has conveinence functions for files. To instantiate, the builder should be used.

Methods

impl Sharer[src]

pub fn builder(secret: Secret) -> SharerBuilder[src]

Constructs the builder with defualt values. See the builder documentation for the default values.

pub fn share(
    &self,
    dests: &mut Vec<Box<dyn Write>>
) -> Result<(), Box<dyn Error>>
[src]

Shares all the shares to individual writeable destinations. This iterates through the secret and calculates the share lists in chunks and writes the shares to their respective destinations

pub fn share_to_files(
    &self,
    dir: &str,
    stem: &str
) -> Result<(), Box<dyn Error>>
[src]

Shares all the shares to separate files for distribution.This is a wrapper for the $share function.

Format: $dir/$stem.s<share_number> For the shares

$stem: Defines the stem of the output files, they will be $stem.s0, $stem.s1, and so on.. $dir: The directory to output the shares to.

If $dir isn't valid, the LAST invalid destination file's error is returned.

pub fn test_reconstruction_file(
    &self,
    dir: Option<&str>
) -> Result<(), Box<dyn Error>>
[src]

Tests the reconstruction of the shares as outputted via the $share_to_files function. $dir: The directory to output the temporary shares. Default is the current dir

pub fn get_secret<'a>(&'a self) -> &'a Secret[src]

Gets an immutable reference to the secret

Trait Implementations

impl Debug for Sharer[src]

Auto Trait Implementations

impl Send for Sharer

impl Sync for Sharer

impl Unpin for Sharer

impl UnwindSafe for Sharer

impl RefUnwindSafe for Sharer

Blanket Implementations

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

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

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

type Error = !

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.

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

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

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