[−][src]Struct sp_application_crypto::ecdsa::Pair
A key pair.
Implementations
impl Pair
[src]
pub fn seed(&self) -> [u8; 32]
[src]
Get the seed for this key.
pub fn from_legacy_string(s: &str, password_override: Option<&str>) -> Pair
[src]
Exactly as from_string
except that if no matches are found then, the the first 32
characters are taken (padded with spaces as necessary) and used as the MiniSecretKey.
Trait Implementations
impl AsMut<Pair> for Pair
[src]
impl AsRef<Pair> for Pair
[src]
impl Clone for Pair
[src]
impl CryptoType for Pair
[src]
impl From<Pair> for Public
[src]
impl From<Pair> for Pair
[src]
impl From<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 = DeriveError
Error returned from the derive
function.
fn generate_with_phrase(password: Option<&str>) -> (Pair, String, [u8; 32])
[src]
Generate new secure (random) key pair and provide the recovery phrase.
You can recover the same key later with from_phrase
.
fn from_phrase(
phrase: &str,
password: Option<&str>
) -> Result<(Pair, [u8; 32]), SecretStringError>
[src]
phrase: &str,
password: Option<&str>
) -> Result<(Pair, [u8; 32]), SecretStringError>
Generate key pair from given recovery phrase and password.
fn from_seed(seed: &[u8; 32]) -> Pair
[src]
Make a new key pair from secret seed material.
You should never need to use this; generate(), generate_with_phrase
fn from_seed_slice(seed_slice: &[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
fn derive<Iter>(
&self,
path: Iter,
_seed: Option<[u8; 32]>
) -> Result<(Pair, Option<[u8; 32]>), DeriveError> where
Iter: Iterator<Item = DeriveJunction>,
[src]
&self,
path: Iter,
_seed: Option<[u8; 32]>
) -> Result<(Pair, Option<[u8; 32]>), DeriveError> where
Iter: Iterator<Item = DeriveJunction>,
Derive a child key from a series of given junctions.
fn public(&self) -> Public
[src]
Get the public key.
fn sign(&self, message: &[u8]) -> Signature
[src]
Sign a message.
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]>,
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]
M: AsRef<[u8]>,
P: AsRef<[u8]>,
Verify a signature on a message. Returns true if the signature is good.
This doesn't use the type system to ensure that sig
and pubkey
are the correct
size. Use it only if you're coming from byte buffers and need the speed.
fn to_raw_vec(&self) -> Vec<u8>
[src]
Return a vec filled with raw data.
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> 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> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, Outer> IsWrappedBy<Outer> for T where
Outer: AsRef<T> + AsMut<T> + From<T>,
T: From<Outer>,
[src]
Outer: AsRef<T> + AsMut<T> + From<T>,
T: From<Outer>,
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,
[src]
T: RefUnwindSafe,
impl<T> Same<T> for T
[src]
type Output = T
Should always be Self
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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
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>,
fn unchecked_into(self) -> T
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
[src]
V: MultiLane<T>,