[][src]Struct sp_keyring::sr25519::sr25519::Pair

pub struct Pair(_);

An Schnorrkel/Ristretto x25519 ("sr25519") key pair.

Methods

impl Pair[src]

pub fn from_entropy(entropy: &[u8], password: Option<&str>) -> (Pair, [u8; 32])[src]

Make a new key pair from binary data derived from a valid seed phrase.

This uses a key derivation function to convert the entropy into a seed, then returns the pair generated from it.

Trait Implementations

impl AsRef<Keypair> for Pair[src]

impl Clone for Pair[src]

impl CryptoType for Pair[src]

type Pair = Pair

The pair key type of this crypto.

impl From<Keypair> for Pair[src]

impl From<Keyring> for Pair[src]

impl From<MiniSecretKey> for Pair[src]

impl From<Pair> for Pair

impl From<SecretKey> for Pair[src]

impl Pair for Pair[src]

type Public = Public

The type which is used to encode a public key.

type Seed = [u8; 32]

The type used to (minimally) encode the data required to securely create a new key pair. Read more

type Signature = Signature

The type used to represent a signature. Can be created from a key pair and a message and verified with the message and a public key. Read more

type DeriveError = Infallible

Error returned from the derive function.

fn from_seed(seed: &[u8; 32]) -> Pair[src]

Make a new key pair from raw secret seed material.

This is generated using schnorrkel's Mini-Secret-Keys.

A MiniSecretKey is literally what Ed25519 calls a SecretKey, which is just 32 random bytes.

fn public(&self) -> Public[src]

Get the public key.

fn from_seed_slice(seed: &[u8]) -> Result<Pair, SecretStringError>[src]

Make a new key pair from secret seed material. The slice must be 32 bytes long or it will return None.

You should never need to use this; generate(), generate_with_phrase(), from_phrase()

fn verify<M>(
    sig: &<Pair as Pair>::Signature,
    message: M,
    pubkey: &<Pair as Pair>::Public
) -> bool where
    M: AsRef<[u8]>, 
[src]

Verify a signature on a message. Returns true if the signature is good.

fn verify_weak<P, M>(sig: &[u8], message: M, pubkey: P) -> bool where
    M: AsRef<[u8]>,
    P: AsRef<[u8]>, 
[src]

Verify a signature on a message. Returns true if the signature is good.

fn to_raw_vec(&self) -> Vec<u8>[src]

Return a vec filled with raw data.

Auto Trait Implementations

impl RefUnwindSafe for Pair

impl Send for Pair

impl Sync for Pair

impl Unpin for Pair

impl UnwindSafe for Pair

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> CheckedConversion for T[src]

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

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

impl<T, Outer> IsWrappedBy<Outer> for T where
    Outer: AsRef<T> + AsMut<T> + From<T>,
    T: From<Outer>, 
[src]

fn from_ref(outer: &Outer) -> &T[src]

Get a reference to the inner from the outer.

fn from_mut(outer: &mut Outer) -> &mut T[src]

Get a mutable reference to the inner from the outer.

impl<T> MaybeRefUnwindSafe for T where
    T: RefUnwindSafe

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> SaturatedConversion for T

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

type Owned = T

The resulting type after obtaining ownership.

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<S, T> UncheckedInto<T> for S where
    T: UncheckedFrom<S>, 
[src]

impl<T, S> UniqueSaturatedInto<T> for S where
    S: TryInto<T>,
    T: Bounded

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,