pub struct NodeFullId { /* private fields */ }Expand description
A struct holding an Ed25519 keypair, an optional BLS keypair share, and the corresponding public ID for a network Node.
Implementations§
Source§impl FullId
impl FullId
Sourcepub fn new<T: CryptoRng + Rng>(rng: &mut T) -> Self
pub fn new<T: CryptoRng + Rng>(rng: &mut T) -> Self
Constructs a FullId with a random Ed25519 keypair and no BLS keys.
Sourcepub fn within_range<T: CryptoRng + Rng>(
start: &XorName,
end: &XorName,
rng: &mut T,
) -> Self
pub fn within_range<T: CryptoRng + Rng>( start: &XorName, end: &XorName, rng: &mut T, ) -> Self
Constructs a FullId whose name is in the interval [start, end] (both endpoints inclusive).
Sourcepub fn sign_using_ed25519<T: AsRef<[u8]>>(&self, data: T) -> Signature
pub fn sign_using_ed25519<T: AsRef<[u8]>>(&self, data: T) -> Signature
Creates a detached Ed25519 signature of data.
Sourcepub fn sign_using_bls<T: AsRef<[u8]>>(&self, data: T) -> Option<Signature>
pub fn sign_using_bls<T: AsRef<[u8]>>(&self, data: T) -> Option<Signature>
Creates a detached BLS signature share of data if the self holds a BLS keypair share.
Sourcepub fn set_bls_keys(
&mut self,
secret_share: BlsSecretKeyShare,
public_set: PublicKeySet,
)
pub fn set_bls_keys( &mut self, secret_share: BlsSecretKeyShare, public_set: PublicKeySet, )
Sets the FullId’s BLS keypair share using the provided BLS secret key share.
Sourcepub fn clear_bls_keys(&mut self)
pub fn clear_bls_keys(&mut self)
Clears the FullId’s BLS keypair share, i.e. sets it to None.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for FullId
impl<'de> Deserialize<'de> for FullId
Source§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 Freeze for FullId
impl RefUnwindSafe for FullId
impl Send for FullId
impl Sync for FullId
impl Unpin for FullId
impl UnwindSafe for FullId
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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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