diff --git a/.gitignore b/.gitignore index ea8c4bf..fba7613 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ /target + +Cargo.lock \ No newline at end of file diff --git a/src/signer.rs b/src/signer.rs index e1edb21..f800360 100644 --- a/src/signer.rs +++ b/src/signer.rs @@ -16,6 +16,6 @@ use crate::SignatureScheme; pub trait Signer { type KeyId; async fn sign(&self, data: &[u8]) -> Result; - async fn public_key(&self) -> Result; + fn public_key(&self) -> Result<&K::PublicKey>; fn key_id(&self) -> &Self::KeyId; } diff --git a/src/storage.rs b/src/storage.rs index d84917e..2a52711 100644 --- a/src/storage.rs +++ b/src/storage.rs @@ -44,8 +44,10 @@ pub trait KeyGenerate { } /// KeySign trait is a trait that is used to sign a hash with a private key located in a key store. The method return a [`Signer`] object. +#[cfg_attr(not(feature = "send-sync-storage"), async_trait(?Send))] +#[cfg_attr(feature = "send-sync-storage", async_trait)] pub trait KeySign { - fn get_signer(&self, key_id: &I) -> Result>; + async fn get_signer(&self, key_id: &I) -> Result>; } /// KeyDelete trait is a trait that is used to delete a key pair from the key store.