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