[][src]Struct sn_data_types::NodeKeypairs

pub struct NodeKeypairs { /* fields omitted */ }

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]

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_id(&self) -> &PublicId[src]

Returns the public keys.

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]

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]

impl Serialize for NodeKeypairs[src]

Auto Trait Implementations

Blanket Implementations

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

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

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

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

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

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

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]

type Error = Infallible

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<V, T> VZip<V> for T where
    V: MultiLane<T>,