pub trait DidKeyStore: Send + Sync {
// Required methods
fn sign(&self, signer: &Did, message: &[u8]) -> Result<String, DidError>;
fn verify(
&self,
method: &VerificationMethod,
message: &[u8],
signature: &str,
) -> Result<(), DidError>;
fn encrypt_for(
&self,
sender: &Did,
recipient_public_key: &[u8],
plaintext: &[u8],
nonce: &[u8],
) -> Result<String, DidError>;
fn decrypt_for(
&self,
recipient: &Did,
sender_public_key: &[u8],
nonce: &[u8],
ciphertext_hex: &str,
) -> Result<Vec<u8>, DidError>;
}Expand description
Key-store and envelope crypto boundary.
Required Methods§
Sourcefn verify(
&self,
method: &VerificationMethod,
message: &[u8],
signature: &str,
) -> Result<(), DidError>
fn verify( &self, method: &VerificationMethod, message: &[u8], signature: &str, ) -> Result<(), DidError>
Verify a signature with the public key in method.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".