pub struct Seed(/* private fields */);
Expand description
Ed25519 seed representing a succession of bytes that can be used for deterministic keypair generation. If the same seed is indicated in the generator multiple times, the generated keys will be the same each time.
Note that this is not the seed added to Exonum transactions for additional security, this is a separate entity. This structure is useful for testing, to receive repeatable results. The seed in this structure is either set manually or selected using the methods below.
§Examples
The example below generates a pair of public and secret keys taking into account the selected seed. The same seed will always lead to generation of the same keypair.
use exonum_crypto::{SEED_LENGTH, Seed};
let (public_key, secret_key) = exonum_crypto::gen_keypair_from_seed(&Seed::new([1; SEED_LENGTH]));
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Seed
impl<'de> Deserialize<'de> for Seed
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
Source§impl ToHex for Seed
impl ToHex for Seed
Source§fn encode_hex<T: FromIterator<char>>(&self) -> T
fn encode_hex<T: FromIterator<char>>(&self) -> T
Encode the hex strict representing
self
into the result. Lower case
letters are used (e.g. f9b4ca
)Source§fn encode_hex_upper<T: FromIterator<char>>(&self) -> T
fn encode_hex_upper<T: FromIterator<char>>(&self) -> T
Encode the hex strict representing
self
into the result. Upper case
letters are used (e.g. F9B4CA
)impl Eq for Seed
impl StructuralPartialEq for Seed
Auto Trait Implementations§
impl Freeze for Seed
impl RefUnwindSafe for Seed
impl Send for Seed
impl Sync for Seed
impl Unpin for Seed
impl UnwindSafe for Seed
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)