Trait avalanche_types::key::secp256k1::SignOnly
source · pub trait SignOnly {
type Error: Error;
// Required methods
fn signing_key(&self) -> Result<SigningKey>;
fn sign_digest<'life0, 'life1, 'async_trait>(
&'life0 self,
digest: &'life1 [u8]
) -> Pin<Box<dyn Future<Output = Result<[u8; 65], Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
}
Expand description
Key interface that “only” allows “sign” operations. Trait is used here to limit access to the underlying private/secret key. or to enable secure remote key management service integration (e.g., KMS ECC_SECG_P256K1).
Required Associated Types§
Required Methods§
fn signing_key(&self) -> Result<SigningKey>
sourcefn sign_digest<'life0, 'life1, 'async_trait>(
&'life0 self,
digest: &'life1 [u8]
) -> Pin<Box<dyn Future<Output = Result<[u8; 65], Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn sign_digest<'life0, 'life1, 'async_trait>( &'life0 self, digest: &'life1 [u8] ) -> Pin<Box<dyn Future<Output = Result<[u8; 65], Self::Error>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,
Signs the 32-byte SHA256 output message with the ECDSA private key and the recoverable code. “github.com/decred/dcrd/dcrec/secp256k1/v3/ecdsa.SignCompact” outputs 65-byte signature. ref. “avalanchego/utils/crypto.PrivateKeySECP256K1R.SignHash” ref. https://github.com/rust-bitcoin/rust-secp256k1/blob/master/src/ecdsa/recovery.rs ref. https://docs.rs/secp256k1/latest/secp256k1/struct.SecretKey.html#method.sign_ecdsa ref. https://docs.rs/secp256k1/latest/secp256k1/struct.Message.html ref. https://pkg.go.dev/github.com/ava-labs/avalanchego/utils/crypto#PrivateKeyED25519.SignHash