[−][src]Struct sn_data_types::NodeKeypairs
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
impl NodeKeypairs
[src]
pub fn new<T: CryptoRng + Rng>(rng: &mut T) -> Self
[src]
Constructs a NodeKeypairs
with a random Ed25519 keypair and no BLS keys.
pub fn within_range<T: CryptoRng + Rng>(
start: &XorName,
end: &XorName,
rng: &mut T
) -> Self
[src]
start: &XorName,
end: &XorName,
rng: &mut T
) -> Self
Constructs a NodeKeypairs
whose name is in the interval [start, end] (both endpoints inclusive).
pub fn public_key(&self) -> PublicKey
[src]
Returns the BLS if any, else the Ed25519.
pub fn public_key_set(&self) -> Option<&PublicKeySet>
[src]
Returns the BLS public key set if any.
pub fn sign(&self, data: &[u8]) -> Signature
[src]
Signs with the BLS if any, else the Ed25519.
pub fn sign_using_ed25519<T: AsRef<[u8]>>(&self, data: T) -> Signature
[src]
Creates a detached Ed25519 signature of data
.
pub fn sign_using_bls<T: AsRef<[u8]>>(&self, data: T) -> Option<Signature>
[src]
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
)
[src]
&mut self,
index: usize,
secret_share: BlsSecretKeyShare,
public_set: PublicKeySet
)
Sets the NodeKeypairs
's BLS keypair share using the provided BLS secret key share.
pub fn clear_bls_keys(&mut self)
[src]
Clears the NodeKeypairs
's BLS keypair share, i.e. sets it to None
.
Trait Implementations
impl<'de> Deserialize<'de> for NodeKeypairs
[src]
pub fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl Serialize for NodeKeypairs
[src]
Auto Trait Implementations
impl RefUnwindSafe for NodeKeypairs
[src]
impl Send for NodeKeypairs
[src]
impl Sync for NodeKeypairs
[src]
impl Unpin for NodeKeypairs
[src]
impl UnwindSafe for NodeKeypairs
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,