Trait xstack::keystore_syscall::DriverKeyStore
source · pub trait DriverKeyStore: Sync + Send {
// Required methods
fn public_key<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<PublicKey>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn sign<'life0, 'life1, 'async_trait>(
&'life0 self,
data: &'life1 [u8],
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
}Expand description
The customize KeyStore must implement this trait.
The stabilization of async functions in traits in Rust 1.75 did not include support for using traits containing async functions as dyn Trait, so we use the async_trait crate to define this trait, to know how to implement the async trait, visit its documentation.
Required Methods§
sourcefn public_key<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<PublicKey>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn public_key<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<PublicKey>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Returns the public key of the node.
Swith use the public key to:
- generate libp2p x509 Public Key Extension;
- generate the node’s PeerId.