Added RuntimePublic for ecdsa public key. (#6029)

* add generate ecdsa, etc to keystore

* impl ecdsa needed traits

* add ecdsa to sr_io

* add ecdsa to application-crypto

* add ecdsa to test-utils

* add ecdsa debug derive

* fix ecdsa public
This commit is contained in:
satellitex
2020-05-16 00:04:38 +09:00
committed by GitHub
parent f36f57b0bf
commit 302c543b49
11 changed files with 364 additions and 14 deletions
+13 -1
View File
@@ -19,7 +19,7 @@
use crate::{
crypto::{KeyTypeId, CryptoTypePublicPair},
ed25519, sr25519,
ed25519, sr25519, ecdsa,
};
use std::{
@@ -77,6 +77,18 @@ pub trait BareCryptoStore: Send + Sync {
id: KeyTypeId,
seed: Option<&str>,
) -> Result<ed25519::Public, BareCryptoStoreError>;
/// Returns all ecdsa public keys for the given key type.
fn ecdsa_public_keys(&self, id: KeyTypeId) -> Vec<ecdsa::Public>;
/// Generate a new ecdsa key pair for the given key type and an optional seed.
///
/// If the given seed is `Some(_)`, the key pair will only be stored in memory.
///
/// Returns the public key of the generated key pair.
fn ecdsa_generate_new(
&mut self,
id: KeyTypeId,
seed: Option<&str>,
) -> Result<ecdsa::Public, BareCryptoStoreError>;
/// Insert a new key. This doesn't require any known of the crypto; but a public key must be
/// manually provided.