Struct sp_keystore::testing::KeyStore [−][src]
pub struct KeyStore { /* fields omitted */ }
Expand description
A keystore implementation usable in tests.
Implementations
Trait Implementations
List all supported keys Read more
Returns all sr25519 public keys for the given key type.
Generate a new sr25519 key pair for the given key type and an optional seed. Read more
Returns all ed25519 public keys for the given key type.
Generate a new ed25519 key pair for the given key type and an optional seed. Read more
Returns all ecdsa public keys for the given key type.
Generate a new ecdsa key pair for the given key type and an optional seed. Read more
Insert a new key. This doesn’t require any known of the crypto; but a public key must be manually provided. Read more
Checks if the private keys for the given public key and key type combinations exist. Read more
fn supported_keys<'life0, 'async_trait>(
&'life0 self,
id: KeyTypeId,
keys: Vec<CryptoTypePublicPair>
) -> Pin<Box<dyn Future<Output = Result<Vec<CryptoTypePublicPair>, Error>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
fn supported_keys<'life0, 'async_trait>(
&'life0 self,
id: KeyTypeId,
keys: Vec<CryptoTypePublicPair>
) -> Pin<Box<dyn Future<Output = Result<Vec<CryptoTypePublicPair>, Error>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Find intersection between provided keys and supported keys Read more
fn sign_with<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
id: KeyTypeId,
key: &'life1 CryptoTypePublicPair,
msg: &'life2 [u8]
) -> Pin<Box<dyn Future<Output = Result<Option<Vec<u8>>, Error>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
fn sign_with<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
id: KeyTypeId,
key: &'life1 CryptoTypePublicPair,
msg: &'life2 [u8]
) -> Pin<Box<dyn Future<Output = Result<Option<Vec<u8>>, Error>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
Sign with key Read more
fn sr25519_vrf_sign<'life0, 'life1, 'async_trait>(
&'life0 self,
key_type: KeyTypeId,
public: &'life1 Public,
transcript_data: VRFTranscriptData
) -> Pin<Box<dyn Future<Output = Result<Option<VRFSignature>, Error>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn sr25519_vrf_sign<'life0, 'life1, 'async_trait>(
&'life0 self,
key_type: KeyTypeId,
public: &'life1 Public,
transcript_data: VRFTranscriptData
) -> Pin<Box<dyn Future<Output = Result<Option<VRFSignature>, Error>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Generate VRF signature for given transcript data. Read more
fn ecdsa_sign_prehashed<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
id: KeyTypeId,
public: &'life1 Public,
msg: &'life2 [u8; 32]
) -> Pin<Box<dyn Future<Output = Result<Option<Signature>, Error>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
fn ecdsa_sign_prehashed<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
id: KeyTypeId,
public: &'life1 Public,
msg: &'life2 [u8; 32]
) -> Pin<Box<dyn Future<Output = Result<Option<Signature>, Error>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
Generate an ECDSA signature for a given pre-hashed message. Read more
fn sign_with_any<'life0, 'life1, 'async_trait>(
&'life0 self,
id: KeyTypeId,
keys: Vec<CryptoTypePublicPair>,
msg: &'life1 [u8]
) -> Pin<Box<dyn Future<Output = Result<Option<(CryptoTypePublicPair, Vec<u8>)>, Error>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn sign_with_any<'life0, 'life1, 'async_trait>(
&'life0 self,
id: KeyTypeId,
keys: Vec<CryptoTypePublicPair>,
msg: &'life1 [u8]
) -> Pin<Box<dyn Future<Output = Result<Option<(CryptoTypePublicPair, Vec<u8>)>, Error>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Sign with any key Read more
fn sign_with_all<'life0, 'life1, 'async_trait>(
&'life0 self,
id: KeyTypeId,
keys: Vec<CryptoTypePublicPair>,
msg: &'life1 [u8]
) -> Pin<Box<dyn Future<Output = Result<Vec<Result<Option<Vec<u8>>, Error>>, ()>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn sign_with_all<'life0, 'life1, 'async_trait>(
&'life0 self,
id: KeyTypeId,
keys: Vec<CryptoTypePublicPair>,
msg: &'life1 [u8]
) -> Pin<Box<dyn Future<Output = Result<Vec<Result<Option<Vec<u8>>, Error>>, ()>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Sign with all keys Read more
Performs the conversion.
Performs the conversion.
List all supported keys Read more
Returns all sr25519 public keys for the given key type.
Generate a new sr25519 key pair for the given key type and an optional seed. Read more
Returns all ed25519 public keys for the given key type.
Generate a new ed25519 key pair for the given key type and an optional seed. Read more
Returns all ecdsa public keys for the given key type.
Generate a new ecdsa key pair for the given key type and an optional seed. Read more
Insert a new key. This doesn’t require any known of the crypto; but a public key must be manually provided. Read more
Checks if the private keys for the given public key and key type combinations exist. Read more
fn supported_keys(
&self,
id: KeyTypeId,
keys: Vec<CryptoTypePublicPair>
) -> Result<Vec<CryptoTypePublicPair>, Error>
fn supported_keys(
&self,
id: KeyTypeId,
keys: Vec<CryptoTypePublicPair>
) -> Result<Vec<CryptoTypePublicPair>, Error>
Find intersection between provided keys and supported keys Read more
Sign with key Read more
fn sr25519_vrf_sign(
&self,
key_type: KeyTypeId,
public: &Public,
transcript_data: VRFTranscriptData
) -> Result<Option<VRFSignature>, Error>
fn sr25519_vrf_sign(
&self,
key_type: KeyTypeId,
public: &Public,
transcript_data: VRFTranscriptData
) -> Result<Option<VRFSignature>, Error>
Generate VRF signature for given transcript data. Read more
Generate an ECDSA signature for a given pre-hashed message. Read more
Sign with any key Read more
Auto Trait Implementations
impl !RefUnwindSafe for KeyStore
impl !UnwindSafe for KeyStore
Blanket Implementations
Mutably borrows from an owned value. Read more
impl<T> Downcast for T where
T: Any,
impl<T> Downcast for T where
T: Any,
Convert Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
. Read more
pub fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
pub fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Convert Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
. Read more
Convert &Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s. Read more
pub fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
pub fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert &mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s. Read more
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
type Output = T
type Output = T
Should always be Self
The counterpart to unchecked_from
.
pub fn vzip(self) -> V