Trait sp_runtime::RuntimeAppPublic [−][src]
A runtime interface for an application's public key.
Associated Types
type Signature: MaybeHash + Clone + PartialEq<Self::Signature> + Eq + Debug + Codec
[src]
The signature that will be generated when signing with the corresponding private key.
Associated Constants
pub const ID: KeyTypeId
[src]
An identifier for this application-specific key type.
pub const CRYPTO_ID: CryptoTypeId
[src]
The identifier of the crypto type of this application-specific key type.
Required methods
pub fn all() -> Vec<Self, Global>
[src]
Returns all public keys for this application in the keystore.
pub fn generate_pair(seed: Option<Vec<u8, Global>>) -> Self
[src]
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.
pub fn sign<M>(&self, msg: &M) -> Option<Self::Signature> where
M: AsRef<[u8]>,
[src]
M: AsRef<[u8]>,
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.
pub fn verify<M>(&self, msg: &M, signature: &Self::Signature) -> bool where
M: AsRef<[u8]>,
[src]
M: AsRef<[u8]>,
Verify that the given signature matches the given message using this public key.
pub fn to_raw_vec(&self) -> Vec<u8, Global>
[src]
Returns Self
as raw vec.
Implementations on Foreign Types
impl RuntimeAppPublic for Public where
Public: RuntimePublic,
<Public as RuntimePublic>::Signature == Signature,
[src]
Public: RuntimePublic,
<Public as RuntimePublic>::Signature == Signature,
pub const ID: KeyTypeId
[src]
pub const CRYPTO_ID: CryptoTypeId
[src]
type Signature = Signature
pub fn all() -> Vec<Public, Global>
[src]
pub fn generate_pair(seed: Option<Vec<u8, Global>>) -> Public
[src]
pub fn sign<M>(
&self,
msg: &M
) -> Option<<Public as RuntimeAppPublic>::Signature> where
M: AsRef<[u8]>,
[src]
&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]>,
[src]
&self,
msg: &M,
signature: &<Public as RuntimeAppPublic>::Signature
) -> bool where
M: AsRef<[u8]>,
pub fn to_raw_vec(&self) -> Vec<u8, Global>
[src]
impl RuntimeAppPublic for Public where
Public: RuntimePublic,
<Public as RuntimePublic>::Signature == Signature,
[src]
Public: RuntimePublic,
<Public as RuntimePublic>::Signature == Signature,
pub const ID: KeyTypeId
[src]
pub const CRYPTO_ID: CryptoTypeId
[src]
type Signature = Signature
pub fn all() -> Vec<Public, Global>
[src]
pub fn generate_pair(seed: Option<Vec<u8, Global>>) -> Public
[src]
pub fn sign<M>(
&self,
msg: &M
) -> Option<<Public as RuntimeAppPublic>::Signature> where
M: AsRef<[u8]>,
[src]
&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]>,
[src]
&self,
msg: &M,
signature: &<Public as RuntimeAppPublic>::Signature
) -> bool where
M: AsRef<[u8]>,
pub fn to_raw_vec(&self) -> Vec<u8, Global>
[src]
impl RuntimeAppPublic for Public where
Public: RuntimePublic,
<Public as RuntimePublic>::Signature == Signature,
[src]
Public: RuntimePublic,
<Public as RuntimePublic>::Signature == Signature,
pub const ID: KeyTypeId
[src]
pub const CRYPTO_ID: CryptoTypeId
[src]
type Signature = Signature
pub fn all() -> Vec<Public, Global>
[src]
pub fn generate_pair(seed: Option<Vec<u8, Global>>) -> Public
[src]
pub fn sign<M>(
&self,
msg: &M
) -> Option<<Public as RuntimeAppPublic>::Signature> where
M: AsRef<[u8]>,
[src]
&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]>,
[src]
&self,
msg: &M,
signature: &<Public as RuntimeAppPublic>::Signature
) -> bool where
M: AsRef<[u8]>,