Struct sp_keystore::testing::KeyStore
source · [−]pub struct KeyStore { /* private fields */ }
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
pub fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>ⓘimpl<W> Write for Box<W, Global> where
W: Write + ?Sized, impl<R> Read for Box<R, Global> where
R: Read + ?Sized, impl<I, A> Iterator for Box<I, A> where
I: Iterator + ?Sized,
A: Allocator, type Item = <I as Iterator>::Item;impl<F, A> Future for Box<F, A> where
F: Future + Unpin + ?Sized,
A: Allocator + 'static, type Output = <F as Future>::Output;
pub fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>ⓘimpl<W> Write for Box<W, Global> where
W: Write + ?Sized, impl<R> Read for Box<R, Global> where
R: Read + ?Sized, impl<I, A> Iterator for Box<I, A> where
I: Iterator + ?Sized,
A: Allocator, type Item = <I as Iterator>::Item;impl<F, A> Future for Box<F, A> where
F: Future + Unpin + ?Sized,
A: Allocator + 'static, type Output = <F as Future>::Output;
impl<W> Write for Box<W, Global> where
W: Write + ?Sized, impl<R> Read for Box<R, Global> where
R: Read + ?Sized, impl<I, A> Iterator for Box<I, A> where
I: Iterator + ?Sized,
A: Allocator, type Item = <I as Iterator>::Item;impl<F, A> Future for Box<F, A> where
F: Future + Unpin + ?Sized,
A: Allocator + 'static, type Output = <F as Future>::Output;
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
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
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
The counterpart to unchecked_from
.
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more