Struct mithril_common::protocol::SignerBuilder
source · pub struct SignerBuilder { /* private fields */ }
Expand description
Allow to build Single Or Multi signers to generate a single signature or aggregate them
Implementations§
source§impl SignerBuilder
impl SignerBuilder
sourcepub fn new(
registered_signers: &[SignerWithStake],
protocol_parameters: &ProtocolParameters,
) -> StdResult<Self>
pub fn new( registered_signers: &[SignerWithStake], protocol_parameters: &ProtocolParameters, ) -> StdResult<Self>
SignerBuilder constructor.
sourcepub fn build_multi_signer(&self) -> MultiSigner
pub fn build_multi_signer(&self) -> MultiSigner
Build a MultiSigner based on the registered parties
sourcepub fn compute_aggregate_verification_key(
&self,
) -> ProtocolAggregateVerificationKey
pub fn compute_aggregate_verification_key( &self, ) -> ProtocolAggregateVerificationKey
Compute aggregate verification key from stake distribution
sourcepub fn build_single_signer(
&self,
signer_with_stake: SignerWithStake,
kes_secret_key_path: Option<&Path>,
) -> StdResult<(SingleSigner, ProtocolInitializer)>
pub fn build_single_signer( &self, signer_with_stake: SignerWithStake, kes_secret_key_path: Option<&Path>, ) -> StdResult<(SingleSigner, ProtocolInitializer)>
Build non deterministic SingleSigner and ProtocolInitializer based on the registered parties.
sourcepub fn build_test_single_signer(
&self,
signer_with_stake: SignerWithStake,
kes_secret_key_path: Option<&Path>,
) -> StdResult<(SingleSigner, ProtocolInitializer)>
pub fn build_test_single_signer( &self, signer_with_stake: SignerWithStake, kes_secret_key_path: Option<&Path>, ) -> StdResult<(SingleSigner, ProtocolInitializer)>
Build deterministic SingleSigner and ProtocolInitializer based on the registered parties.
Use for TEST ONLY.
sourcepub fn restore_signer_from_initializer(
&self,
party_id: PartyId,
protocol_initializer: ProtocolInitializer,
) -> StdResult<SingleSigner>
pub fn restore_signer_from_initializer( &self, party_id: PartyId, protocol_initializer: ProtocolInitializer, ) -> StdResult<SingleSigner>
Restore a SingleSigner based on the registered parties and the given protocol_initializer.
This is useful since each protocol initializer holds a unique secret key that corresponds to a registration key sent to an aggregator.
The actual signing of message is done at a later epoch.
The SignerBuilder used must be tied to the key registration, stake distribution and protocol parameters of the epoch during which the given protocol initializer was created.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SignerBuilder
impl RefUnwindSafe for SignerBuilder
impl Send for SignerBuilder
impl Sync for SignerBuilder
impl Unpin for SignerBuilder
impl UnwindSafe for SignerBuilder
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CheckedAs for T
impl<T> CheckedAs for T
source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more