[][src]Struct tmkms::keyring::ed25519::Seed

pub struct Seed(pub [u8; 32]);

Ed25519 seeds: derivation secrets for Ed25519 private scalars/nonce prefixes

Methods

impl Seed[src]

pub fn new(bytes: [u8; 32]) -> Seed[src]

Create an Ed25519 seed from a 32-byte array

pub fn generate() -> Seed[src]

Generate a new Ed25519 seed using the operating system's cryptographically secure random number generator

pub fn from_bytes<B>(bytes: B) -> Option<Seed> where
    B: AsRef<[u8]>, 
[src]

Create an Ed25519 seed from a byte slice, returning KeyInvalid if the slice is not the correct size (32-bytes)

pub fn from_keypair(keypair: &[u8]) -> Option<Seed>[src]

Create an Ed25519 seed from a keypair: i.e. a seed and its assocaited public key (i.e. compressed Edwards-y coordinate)

pub fn decode_keypair<E>(
    encoded_keypair: &[u8],
    encoding: &E
) -> Result<Seed, Error> where
    E: Encoding
[src]

Decode a Seed from an encoded (hex or Base64) Ed25519 keypair

pub fn as_secret_slice(&self) -> &[u8][src]

Expose the secret values of the Seed as a byte slice

Trait Implementations

impl<'a> From<&'a Ed25519Keypair> for Seed[src]

impl Drop for Seed[src]

impl Encode for Seed[src]

fn encode<E>(&self, encoding: &E) -> Vec<u8> where
    E: Encoding
[src]

Encode an Ed25519 seed with the given encoding (e.g. hex, Base64)

fn encode_to_string<E>(&self, encoding: &E) -> Result<String, Error> where
    E: Encoding
[src]

Encode self to a String using the provided Encoding, returning the encoded value or a Error. Read more

fn encode_to_writer<W, E>(
    &self,
    writer: &mut W,
    encoding: &E
) -> Result<usize, Error> where
    E: Encoding,
    W: Write
[src]

Encode self with the given Encoding, writing the result to the supplied io::Write type, returning the number of bytes written or a Error. Read more

fn encode_to_file<P, E>(&self, path: P, encoding: &E) -> Result<File, Error> where
    E: Encoding,
    P: AsRef<Path>, 
[src]

Encode self and write it to a file at the given path, returning the resulting File or a Error. Read more

impl Decode for Seed[src]

fn decode<E>(encoded_seed: &[u8], encoding: &E) -> Result<Seed, Error> where
    E: Encoding
[src]

Decode an Ed25519 seed from a byte slice with the given encoding (e.g. hex, Base64)

fn decode_from_str<S, E>(encoded_str: S, encoding: &E) -> Result<Self, Error> where
    E: Encoding,
    S: AsRef<str>, 
[src]

Decode the given string-alike type with the provided Encoding, returning the decoded value or a Error. Read more

fn decode_from_reader<R, E>(reader: &mut R, encoding: &E) -> Result<Self, Error> where
    E: Encoding,
    R: Read
[src]

Decode the data read from the given io::Read type with the provided Encoding, returning the decoded value or a Error. Read more

fn decode_from_file<P, E>(path: P, encoding: &E) -> Result<Self, Error> where
    E: Encoding,
    P: AsRef<Path>, 
[src]

Read a file at the given path, decoding the data it contains using the provided Encoding, returning the decoded value or a Error. Read more

impl From<[u8; 32]> for Seed[src]

impl Clone for Seed[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

Auto Trait Implementations

impl Sync for Seed

impl Send for Seed

impl Unpin for Seed

impl RefUnwindSafe for Seed

impl UnwindSafe for Seed

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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

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

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<T> BorrowMut<T> for T where
    T: ?Sized
[src]

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

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

impl<T> Same<T> for T

type Output = T

Should always be Self