Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
/target

Cargo.lock
2 changes: 1 addition & 1 deletion src/signer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ use crate::SignatureScheme;
pub trait Signer<K: SignatureScheme> {
type KeyId;
async fn sign(&self, data: &[u8]) -> Result<K::Signature>;
async fn public_key(&self) -> Result<K::PublicKey>;
fn public_key(&self) -> Result<&K::PublicKey>;
fn key_id(&self) -> &Self::KeyId;
}
4 changes: 3 additions & 1 deletion src/storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,10 @@ pub trait KeyGenerate<K: SignatureScheme, I> {
}

/// 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<K: SignatureScheme, I> {
fn get_signer(&self, key_id: &I) -> Result<impl Signer<K, KeyId = I>>;
async fn get_signer(&self, key_id: &I) -> Result<impl Signer<K, KeyId = I>>;
}

/// KeyDelete trait is a trait that is used to delete a key pair from the key store.
Expand Down
Loading