pub trait SecretKeyTrait: PublicKeyTrait {
type PublicKey;
type Unlocked;
// Required methods
fn unlock<F, G, T>(&self, pw: F, work: G) -> Result<T>
where F: FnOnce() -> String,
G: FnOnce(&Self::Unlocked) -> Result<T>;
fn create_signature<F>(
&self,
key_pw: F,
hash: HashAlgorithm,
data: &[u8],
) -> Result<SignatureBytes>
where F: FnOnce() -> String;
fn public_key(&self) -> Self::PublicKey;
// Provided method
fn hash_alg(&self) -> HashAlgorithm { ... }
}
Required Associated Types§
Required Methods§
Sourcefn unlock<F, G, T>(&self, pw: F, work: G) -> Result<T>
fn unlock<F, G, T>(&self, pw: F, work: G) -> Result<T>
Unlock the raw data in the secret parameters.
fn create_signature<F>( &self, key_pw: F, hash: HashAlgorithm, data: &[u8], ) -> Result<SignatureBytes>
fn public_key(&self) -> Self::PublicKey
Provided Methods§
Sourcefn hash_alg(&self) -> HashAlgorithm
fn hash_alg(&self) -> HashAlgorithm
The suggested hash algorithm to calculate the signature hash digest with, when using this key as a signer
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.