pub trait SignOnly {
fn sign_digest(&self, digest: &[u8]) -> Result<[u8; 65]>;
fn ethers_signing_key(&self) -> Result<SigningKey>;
}
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 Methods
sourcefn sign_digest(&self, digest: &[u8]) -> Result<[u8; 65]>
fn sign_digest(&self, digest: &[u8]) -> Result<[u8; 65]>
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
sourcefn ethers_signing_key(&self) -> Result<SigningKey>
fn ethers_signing_key(&self) -> Result<SigningKey>
Returns the ethers signing key.