Type Alias Pair
pub type Pair = Pair<TinyBLS<Bls12<Config>, Config>>;
Expand description
BLS12-381 key pair.
Aliased Type§
struct Pair(/* private fields */);
Trait Implementations§
§impl<T> CryptoType for Pair<T>where
T: BlsBound,
impl<T> CryptoType for Pair<T>where
T: BlsBound,
§impl<T> Pair for Pair<T>where
T: BlsBound,
impl<T> Pair for Pair<T>where
T: BlsBound,
§fn to_raw_vec(&self) -> Vec<u8> ⓘ
fn to_raw_vec(&self) -> Vec<u8> ⓘ
Get the seed for this key.
§type Seed = [u8; 32]
type Seed = [u8; 32]
The type used to (minimally) encode the data required to securely create
a new key pair.
§type Public = CryptoBytes<sp_core::::bls::Public::{constant#0}, (PublicTag, (BlsTag, T))>
type Public = CryptoBytes<sp_core::::bls::Public::{constant#0}, (PublicTag, (BlsTag, T))>
The type which is used to encode a public key.
§type Signature = CryptoBytes<sp_core::::bls::Signature::{constant#0}, (SignatureTag, (BlsTag, T))>
type Signature = CryptoBytes<sp_core::::bls::Signature::{constant#0}, (SignatureTag, (BlsTag, T))>
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.
§fn from_seed_slice(seed_slice: &[u8]) -> Result<Pair<T>, SecretStringError>
fn from_seed_slice(seed_slice: &[u8]) -> Result<Pair<T>, SecretStringError>
Make a new key pair from secret seed material. The slice must be the correct size or
an error will be returned. Read more
§fn derive<Iter>(
&self,
path: Iter,
seed: Option<[u8; 32]>,
) -> Result<(Pair<T>, Option<[u8; 32]>), DeriveError>where
Iter: Iterator<Item = DeriveJunction>,
fn derive<Iter>(
&self,
path: Iter,
seed: Option<[u8; 32]>,
) -> Result<(Pair<T>, Option<[u8; 32]>), DeriveError>where
Iter: Iterator<Item = DeriveJunction>,
Derive a child key from a series of given junctions.
§fn verify<M>(
sig: &<Pair<T> as Pair>::Signature,
message: M,
pubkey: &<Pair<T> as Pair>::Public,
) -> bool
fn verify<M>( sig: &<Pair<T> as Pair>::Signature, message: M, pubkey: &<Pair<T> as Pair>::Public, ) -> bool
Verify a signature on a message. Returns true if the signature is good.
§fn generate_with_phrase(password: Option<&str>) -> (Self, String, Self::Seed)
fn generate_with_phrase(password: Option<&str>) -> (Self, String, Self::Seed)
Generate new secure (random) key pair and provide the recovery phrase. Read more
§fn from_phrase(
phrase: &str,
password: Option<&str>,
) -> Result<(Self, Self::Seed), SecretStringError>
fn from_phrase( phrase: &str, password: Option<&str>, ) -> Result<(Self, Self::Seed), SecretStringError>
Returns the KeyPair from the English BIP39 seed
phrase
, or an error if it’s invalid.§fn from_string_with_seed(
s: &str,
password_override: Option<&str>,
) -> Result<(Self, Option<Self::Seed>), SecretStringError>
fn from_string_with_seed( s: &str, password_override: Option<&str>, ) -> Result<(Self, Option<Self::Seed>), SecretStringError>
Interprets the string
s
in order to generate a key Pair. Returns both the pair and an
optional seed, in the case that the pair can be expressed as a direct derivation from a seed
(some cases, such as Sr25519 derivations with path components, cannot). Read more