Struct sp_runtime::testing::sr25519::Pair [−][src]
An Schnorrkel/Ristretto x25519 (“sr25519”) key pair.
Implementations
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>(
sig: &Signature,
message: M,
pubkey: &Public
) -> bool where
M: AsRef<[u8]>,
[src]
sig: &Signature,
message: M,
pubkey: &Public
) -> bool where
M: AsRef<[u8]>,
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 AsRef<Keypair> for Pair
[src]
impl Clone for Pair
[src]
impl CryptoType for Pair
[src]
impl From<Keypair> for Pair
[src]
impl From<MiniSecretKey> for Pair
[src]
pub fn from(sec: MiniSecretKey) -> Pair
[src]
impl From<Pair> for Pair
[src]
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.
pub 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.
pub fn public(&self) -> Public
[src]
Get the public key.
pub 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()
pub fn generate_with_phrase(password: Option<&str>) -> (Pair, String, [u8; 32])
[src]
pub fn from_phrase(
phrase: &str,
password: Option<&str>
) -> Result<(Pair, [u8; 32]), SecretStringError>
[src]
phrase: &str,
password: Option<&str>
) -> Result<(Pair, [u8; 32]), SecretStringError>
pub fn derive<Iter>(
&self,
path: Iter,
seed: Option<[u8; 32]>
) -> Result<(Pair, Option<[u8; 32]>), <Pair as Pair>::DeriveError> where
Iter: Iterator<Item = DeriveJunction>,
[src]
&self,
path: Iter,
seed: Option<[u8; 32]>
) -> Result<(Pair, Option<[u8; 32]>), <Pair as Pair>::DeriveError> where
Iter: Iterator<Item = DeriveJunction>,
pub fn sign(&self, message: &[u8]) -> Signature
[src]
pub fn verify<M>(
sig: &<Pair as Pair>::Signature,
message: M,
pubkey: &<Pair as Pair>::Public
) -> bool where
M: AsRef<[u8]>,
[src]
sig: &<Pair as Pair>::Signature,
message: M,
pubkey: &<Pair as Pair>::Public
) -> bool where
M: AsRef<[u8]>,
pub fn verify_weak<P, M>(sig: &[u8], message: M, pubkey: P) -> bool where
M: AsRef<[u8]>,
P: AsRef<[u8]>,
[src]
M: AsRef<[u8]>,
P: AsRef<[u8]>,
pub fn to_raw_vec(&self) -> Vec<u8, Global>
[src]
pub fn generate() -> (Self, Self::Seed)
[src]
pub 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>
pub 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> 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,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> CheckedConversion for T
[src]
fn checked_from<T>(t: T) -> Option<Self> where
Self: TryFrom<T>,
[src]
Self: TryFrom<T>,
fn checked_into<T>(self) -> Option<T> where
Self: TryInto<T>,
[src]
Self: TryInto<T>,
impl<T> DynClone for T where
T: Clone,
[src]
T: Clone,
pub fn __clone_box(&self, Private) -> *mut ()
[src]
impl<T> From<T> 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, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, Outer> IsWrappedBy<Outer> for T where
T: From<Outer>,
Outer: AsRef<T> + AsMut<T> + From<T>,
[src]
T: From<Outer>,
Outer: AsRef<T> + AsMut<T> + From<T>,
pub fn from_ref(outer: &Outer) -> &T
[src]
Get a reference to the inner from the outer.
pub 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,
[src]
T: RefUnwindSafe,
impl<T> Pointable for T
[src]
pub const ALIGN: usize
[src]
type Init = T
The type for initializers.
pub unsafe fn init(init: <T as Pointable>::Init) -> usize
[src]
pub unsafe fn deref<'a>(ptr: usize) -> &'a T
[src]
pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
[src]
pub unsafe fn drop(ptr: usize)
[src]
impl<T> Same<T> for T
[src]
type Output = T
Should always be Self
impl<T> SaturatedConversion for T
[src]
pub fn saturated_from<T>(t: T) -> Self where
Self: UniqueSaturatedFrom<T>,
[src]
Self: UniqueSaturatedFrom<T>,
pub fn saturated_into<T>(self) -> T where
Self: UniqueSaturatedInto<T>,
[src]
Self: UniqueSaturatedInto<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub 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.
pub 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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<S, T> UncheckedInto<T> for S where
T: UncheckedFrom<S>,
[src]
T: UncheckedFrom<S>,
pub fn unchecked_into(self) -> T
[src]
impl<T, S> UniqueSaturatedInto<T> for S where
T: Bounded,
S: TryInto<T>,
[src]
T: Bounded,
S: TryInto<T>,
pub fn unique_saturated_into(self) -> T
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
[src]
V: MultiLane<T>,