Struct sp_core::sr25519::Pair [−][src]
pub struct Pair(_);
An Schnorrkel/Ristretto x25519 (“sr25519”) key pair.
Implementations
impl Pair[src]
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.
pub fn verify_deprecated<M: AsRef<[u8]>>(
sig: &Signature,
message: M,
pubkey: &Public
) -> bool[src]
sig: &Signature,
message: M,
pubkey: &Public
) -> bool
Verify a signature on a message. Returns true if the signature is good.
Supports old 0.1.1 deprecated signatures and should be used only for backward
compatibility.
Trait Implementations
impl Clone for Pair[src]
impl Clone for Pair[src]fn clone(&self) -> Self[src]
pub fn clone_from(&mut self, source: &Self)1.0.0[src]
impl CryptoType for Pair[src]
impl CryptoType for Pair[src]impl From<MiniSecretKey> for Pair[src]
impl From<MiniSecretKey> for Pair[src]fn from(sec: MiniSecretKey) -> Pair[src]
impl Pair 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 generate_with_phrase(password: Option<&str>) -> (Pair, String, [u8; 32])[src]
fn from_phrase(
phrase: &str,
password: Option<&str>
) -> Result<(Pair, [u8; 32]), SecretStringError>[src]
phrase: &str,
password: Option<&str>
) -> Result<(Pair, [u8; 32]), SecretStringError>
fn derive<Iter: Iterator<Item = DeriveJunction>>(
&self,
path: Iter,
seed: Option<[u8; 32]>
) -> Result<(Pair, Option<[u8; 32]>), Self::DeriveError>[src]
&self,
path: Iter,
seed: Option<[u8; 32]>
) -> Result<(Pair, Option<[u8; 32]>), Self::DeriveError>
fn sign(&self, message: &[u8]) -> Signature[src]
fn verify<M: AsRef<[u8]>>(
sig: &Self::Signature,
message: M,
pubkey: &Self::Public
) -> bool[src]
sig: &Self::Signature,
message: M,
pubkey: &Self::Public
) -> bool
fn verify_weak<P: AsRef<[u8]>, M: AsRef<[u8]>>(
sig: &[u8],
message: M,
pubkey: P
) -> bool[src]
sig: &[u8],
message: M,
pubkey: P
) -> bool
fn to_raw_vec(&self) -> Vec<u8>[src]
fn generate() -> (Self, Self::Seed)[src]
fn from_string_with_seed(
s: &str,
password_override: Option<&str>
) -> Result<(Self, Option<Self::Seed>), SecretStringError>[src]
s: &str,
password_override: Option<&str>
) -> Result<(Self, Option<Self::Seed>), SecretStringError>
fn from_string(
s: &str,
password_override: Option<&str>
) -> Result<Self, SecretStringError>[src]
s: &str,
password_override: Option<&str>
) -> Result<Self, SecretStringError>
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> Instrument for T[src]
impl<T> Instrument for T[src]pub fn instrument(self, span: Span) -> Instrumented<Self>[src]
pub fn in_current_span(self) -> Instrumented<Self>[src]
impl<T, Outer> IsWrappedBy<Outer> for T where
T: From<Outer>,
Outer: AsRef<T> + AsMut<T> + From<T>, [src]
impl<T, Outer> IsWrappedBy<Outer> for T where
T: From<Outer>,
Outer: AsRef<T> + AsMut<T> + From<T>, [src]impl<S, T> UncheckedInto<T> for S where
T: UncheckedFrom<S>, [src]
impl<S, T> UncheckedInto<T> for S where
T: UncheckedFrom<S>, [src]pub fn unchecked_into(Self) -> T[src]
impl<T> MaybeRefUnwindSafe for T where
T: RefUnwindSafe, [src]
T: RefUnwindSafe,