Pair

Type Alias Pair 

Source
pub type Pair = GenericPair<Public>;
Expand description

An ecdsa key pair using the blake2 algorithm for hashing the message.

Aliased Type§

pub struct Pair { /* private fields */ }

Trait Implementations§

Source§

impl CryptoType for Pair

Source§

type Pair = GenericPair<CryptoBytes<PUBLIC_KEY_SERIALIZED_SIZE, (PublicTag, EcdsaTag)>>

The pair key type of this crypto.
Source§

impl NonAggregatable for Pair

Source§

fn proof_of_possession_statement(owner: &[u8]) -> Vec<u8>

Default proof_of_possession statement.
Source§

impl Pair for Pair

Source§

fn verify<M: AsRef<[u8]>>( sig: &Self::Signature, message: M, public: &Public, ) -> bool

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

Source§

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

Return a vec filled with raw data.

Source§

type Public = CryptoBytes<PUBLIC_KEY_SERIALIZED_SIZE, (PublicTag, EcdsaTag)>

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

type Seed = [u8; 32]

The type used to (minimally) encode the data required to securely create a new key pair.
Source§

type Signature = CryptoBytes<SIGNATURE_SERIALIZED_SIZE, (SignatureTag, CryptoBytes<PUBLIC_KEY_SERIALIZED_SIZE, (PublicTag, EcdsaTag)>)>

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.
Source§

type ProofOfPossession = CryptoBytes<SIGNATURE_SERIALIZED_SIZE, (SignatureTag, CryptoBytes<PUBLIC_KEY_SERIALIZED_SIZE, (PublicTag, EcdsaTag)>)>

The type used to represent proof of possession and ownership of private key is usually one or a set of signatures. Can be created from a key pair and message (owner id) and and verified with the owner id and public key.
Source§

fn from_seed_slice(seed_slice: &[u8]) -> Result<Self, 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
Source§

fn derive<Iter: Iterator<Item = DeriveJunction>>( &self, path: Iter, _seed: Option<[u8; 32]>, ) -> Result<(Self, Option<[u8; 32]>), DeriveError>

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

fn public(&self) -> Self::Public

Get the public key.
Source§

fn sign(&self, message: &[u8]) -> Self::Signature

Sign a message.
Source§

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

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

fn generate_with_phrase(password: Option<&str>) -> (Self, String, Self::Seed)

Generate new secure (random) key pair and provide the recovery phrase. Read more
Source§

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.
Source§

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

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

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
Source§

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