Trait sp_runtime::RuntimeAppPublic
source · [−]pub trait RuntimeAppPublic {
type Signature: Codec + Debug + MaybeHash + Eq + PartialEq<Self::Signature> + Clone;
const ID: KeyTypeId;
const CRYPTO_ID: CryptoTypeId;
fn all() -> Vec<Self, Global>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
;
fn generate_pair(seed: Option<Vec<u8, Global>>) -> Self;
fn sign<M>(&self, msg: &M) -> Option<Self::Signature>
where
M: AsRef<[u8]>;
fn verify<M>(&self, msg: &M, signature: &Self::Signature) -> bool
where
M: AsRef<[u8]>;
fn to_raw_vec(&self) -> Vec<u8, Global>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
;
}
Expand description
A runtime interface for an application’s public key.
Associated Types
Associated Constants
const CRYPTO_ID: CryptoTypeId
const CRYPTO_ID: CryptoTypeId
The identifier of the crypto type of this application-specific key type.
Required methods
Returns all public keys for this application in the keystore.
Generate a public/private pair with an optional seed
and store it in the keystore.
The seed
needs to be valid utf8.
Returns the generated public key.
Sign the given message with the corresponding private key of this public key.
The private key will be requested from the keystore.
Returns the signature or None
if the private key could not be found or some other error
occurred.
Verify that the given signature matches the given message using this public key.
Implementations on Foreign Types
sourceimpl RuntimeAppPublic for Public where
Public: RuntimePublic,
<Public as RuntimePublic>::Signature == Signature,
impl RuntimeAppPublic for Public where
Public: RuntimePublic,
<Public as RuntimePublic>::Signature == Signature,
pub const ID: KeyTypeId
pub const CRYPTO_ID: CryptoTypeId
type Signature = Signature
pub fn all() -> Vec<Public, Global>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
pub fn generate_pair(seed: Option<Vec<u8, Global>>) -> Public
pub fn sign<M>(
&self,
msg: &M
) -> Option<<Public as RuntimeAppPublic>::Signature> where
M: AsRef<[u8]>,
pub fn verify<M>(
&self,
msg: &M,
signature: &<Public as RuntimeAppPublic>::Signature
) -> bool where
M: AsRef<[u8]>,
pub fn to_raw_vec(&self) -> Vec<u8, Global>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
sourceimpl RuntimeAppPublic for Public where
Public: RuntimePublic,
<Public as RuntimePublic>::Signature == Signature,
impl RuntimeAppPublic for Public where
Public: RuntimePublic,
<Public as RuntimePublic>::Signature == Signature,
pub const ID: KeyTypeId
pub const CRYPTO_ID: CryptoTypeId
type Signature = Signature
pub fn all() -> Vec<Public, Global>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
pub fn generate_pair(seed: Option<Vec<u8, Global>>) -> Public
pub fn sign<M>(
&self,
msg: &M
) -> Option<<Public as RuntimeAppPublic>::Signature> where
M: AsRef<[u8]>,
pub fn verify<M>(
&self,
msg: &M,
signature: &<Public as RuntimeAppPublic>::Signature
) -> bool where
M: AsRef<[u8]>,
pub fn to_raw_vec(&self) -> Vec<u8, Global>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
sourceimpl RuntimeAppPublic for Public where
Public: RuntimePublic,
<Public as RuntimePublic>::Signature == Signature,
impl RuntimeAppPublic for Public where
Public: RuntimePublic,
<Public as RuntimePublic>::Signature == Signature,
pub const ID: KeyTypeId
pub const CRYPTO_ID: CryptoTypeId
type Signature = Signature
pub fn all() -> Vec<Public, Global>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
pub fn generate_pair(seed: Option<Vec<u8, Global>>) -> Public
pub fn sign<M>(
&self,
msg: &M
) -> Option<<Public as RuntimeAppPublic>::Signature> where
M: AsRef<[u8]>,
pub fn verify<M>(
&self,
msg: &M,
signature: &<Public as RuntimeAppPublic>::Signature
) -> bool where
M: AsRef<[u8]>,
pub fn to_raw_vec(&self) -> Vec<u8, Global>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,