Type Alias Public
pub type Public = CryptoBytes<sp_core::::sr25519::Public::{constant#0}, Sr25519PublicTag>;
Expand description
An Schnorrkel/Ristretto x25519 (“sr25519”) public key.
Aliased Type§
struct Public(pub [u8; 32], _);
Fields§
§0: [u8; 32]
Trait Implementations§
Source§impl RuntimePublic for Public
impl RuntimePublic for Public
Source§type Signature = CryptoBytes<sp_core::::sr25519::Signature::{constant#0}, (SignatureTag, Sr25519Tag)>
type Signature = CryptoBytes<sp_core::::sr25519::Signature::{constant#0}, (SignatureTag, Sr25519Tag)>
The signature that will be generated when signing with the corresponding private key.
Source§type ProofOfPossession = CryptoBytes<sp_core::::sr25519::Signature::{constant#0}, (SignatureTag, Sr25519Tag)>
type ProofOfPossession = CryptoBytes<sp_core::::sr25519::Signature::{constant#0}, (SignatureTag, Sr25519Tag)>
The Proof Of Possession the corresponding private key.
Source§fn all(key_type: KeyTypeId) -> Vec<Self>
fn all(key_type: KeyTypeId) -> Vec<Self>
Returns all public keys for the given key type in the keystore.
Source§fn generate_pair(key_type: KeyTypeId, seed: Option<Vec<u8>>) -> Self
fn generate_pair(key_type: KeyTypeId, seed: Option<Vec<u8>>) -> Self
Generate a public/private pair for the given key type with an optional
seed
and
store it in the keystore. Read moreSource§fn sign<M: AsRef<[u8]>>(
&self,
key_type: KeyTypeId,
msg: &M,
) -> Option<Self::Signature>
fn sign<M: AsRef<[u8]>>( &self, key_type: KeyTypeId, msg: &M, ) -> Option<Self::Signature>
Sign the given message with the corresponding private key of this public key. Read more
Source§fn verify<M: AsRef<[u8]>>(&self, msg: &M, signature: &Self::Signature) -> bool
fn verify<M: AsRef<[u8]>>(&self, msg: &M, signature: &Self::Signature) -> bool
Verify that the given signature matches the given message using this public key.
Source§fn generate_proof_of_possession(
&mut self,
key_type: KeyTypeId,
owner: &[u8],
) -> Option<Self::ProofOfPossession>
fn generate_proof_of_possession( &mut self, key_type: KeyTypeId, owner: &[u8], ) -> Option<Self::ProofOfPossession>
Generates the necessary proof(s) usually as a signature or list of signatures, for the
corresponding public key to be accepted as legitimate by the network. Read more
Source§fn verify_proof_of_possession(
&self,
owner: &[u8],
proof_of_possession: &Self::ProofOfPossession,
) -> bool
fn verify_proof_of_possession( &self, owner: &[u8], proof_of_possession: &Self::ProofOfPossession, ) -> bool
Verifies that the given proof is valid for the corresponding public key.
The proof is usually a signature or list of signatures, for the corresponding
public key to be accepted by the network. It include attestation of the owner of
the public key in the form signing the owner’s identity but might also includes
other signatures. Read more