[−][src]Struct exonum_crypto::Seed
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]));
Methods
impl Seed
[src]
impl Seed
[src]
pub fn new(bytes_array: [u8; 32]) -> Self
[src]
Creates a new instance from bytes array.
pub fn from_slice(bytes_slice: &[u8]) -> Option<Self>
[src]
Creates a new instance from bytes slice.
pub fn to_hex(&self) -> String
[src]
Returns a hex representation of binary data. Lower case letters are used (e.g. f9b4ca).
Trait Implementations
impl Clone for Seed
[src]
impl Debug for Seed
[src]
impl Default for Seed
[src]
impl<'de> Deserialize<'de> for Seed
[src]
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where
D: Deserializer<'de>,
[src]
D: Deserializer<'de>,
impl Eq for Seed
[src]
impl FromHex for Seed
[src]
impl Index<Range<usize>> for Seed
[src]
type Output = [u8]
The returned type after indexing.
fn index(&self, _index: Range<usize>) -> &[u8]
[src]
impl Index<RangeFrom<usize>> for Seed
[src]
type Output = [u8]
The returned type after indexing.
fn index(&self, _index: RangeFrom<usize>) -> &[u8]
[src]
impl Index<RangeFull> for Seed
[src]
type Output = [u8]
The returned type after indexing.
fn index(&self, _index: RangeFull) -> &[u8]
[src]
impl Index<RangeTo<usize>> for Seed
[src]
type Output = [u8]
The returned type after indexing.
fn index(&self, _index: RangeTo<usize>) -> &[u8]
[src]
impl PartialEq<Seed> for Seed
[src]
impl Serialize for Seed
[src]
impl StructuralEq for Seed
[src]
impl StructuralPartialEq for Seed
[src]
impl ToHex for Seed
[src]
fn encode_hex<T: FromIterator<char>>(&self) -> T
[src]
fn encode_hex_upper<T: FromIterator<char>>(&self) -> T
[src]
Auto Trait Implementations
impl RefUnwindSafe for Seed
impl Send for Seed
impl Sync for Seed
impl Unpin for Seed
impl UnwindSafe for Seed
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,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
T: 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> ToHex for T where
T: AsRef<[u8]>,
[src]
T: AsRef<[u8]>,
fn encode_hex<U>(&self) -> U where
U: FromIterator<char>,
[src]
U: FromIterator<char>,
fn encode_hex_upper<U>(&self) -> U where
U: FromIterator<char>,
[src]
U: FromIterator<char>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
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.
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>,