Struct safe_network::types::NodeKeypairs
source · [−]pub struct NodeKeypairs { /* private fields */ }
Expand description
This is used at a network node for holding the obligatory Ed25519 keypair needed as Adult, and then a BLS keypair share when being promoted to Elder. (Also the corresponding public keys). The Ed25519 is kept as Elder, in case it is demoted.
Implementations
Constructs a NodeKeypairs
with a random Ed25519 keypair and no BLS keys.
Constructs a NodeKeypairs
whose name is in the interval [start, end] (both endpoints inclusive).
Returns the BLS if any, else the Ed25519.
Returns the BLS public key set if any.
Creates a detached Ed25519 signature of data
.
Creates a detached BLS signature share of data
if the self
holds a BLS keypair share.
pub fn set_bls_keys(
&mut self,
index: usize,
secret_share: BlsSecretKeyShare,
public_set: PublicKeySet
)
pub fn set_bls_keys(
&mut self,
index: usize,
secret_share: BlsSecretKeyShare,
public_set: PublicKeySet
)
Sets the NodeKeypairs
’s BLS keypair share using the provided BLS secret key share.
Clears the NodeKeypairs
’s BLS keypair share, i.e. sets it to None
.
Trait Implementations
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations
impl RefUnwindSafe for NodeKeypairs
impl Send for NodeKeypairs
impl Sync for NodeKeypairs
impl Unpin for NodeKeypairs
impl UnwindSafe for NodeKeypairs
Blanket Implementations
Mutably borrows from an owned value. Read more
pub fn vzip(self) -> V
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more