referrerpolicy=no-referrer-when-downgrade
sp_application_crypto::bls381

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§

Source§

impl From<Pair> for Pair

Source§

fn from(outer: Pair) -> Self

Converts to this type from the input type.
§

impl<T> Clone for Pair<T>
where T: EngineBLS,

§

fn clone(&self) -> Pair<T>

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl<T> CryptoType for Pair<T>
where T: BlsBound,

§

type Pair = Pair<T>

The pair key type of this crypto.
§

impl<T> Pair for Pair<T>
where T: BlsBound,

§

fn to_raw_vec(&self) -> Vec<u8>

Get the seed for this key.

§

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))>

The type which is used to encode a public key.
§

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>

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>,

Derive a child key from a series of given junctions.
§

fn public(&self) -> <Pair<T> as Pair>::Public

Get the public key.
§

fn sign(&self, message: &[u8]) -> <Pair<T> as Pair>::Signature

Sign a message.
§

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

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

fn generate() -> (Self, Self::Seed)

Generate new secure (random) key pair. Read more
§

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>

Returns the KeyPair from the English BIP39 seed phrase, or an error if it’s invalid.
§

fn from_seed(seed: &Self::Seed) -> Self

Generate new key pair from the provided seed. Read more
§

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
§

fn from_string( s: &str, password_override: Option<&str>, ) -> Result<Self, SecretStringError>

Interprets the string s in order to generate a key pair. Read more