Trait GoogleCloudKmsEvmService

Source
pub trait GoogleCloudKmsEvmService: Send + Sync {
    // Required methods
    fn get_evm_address<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = GoogleCloudKmsResult<Address>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn sign_payload_evm<'life0, 'life1, 'async_trait>(
        &'life0 self,
        payload: &'life1 [u8],
    ) -> Pin<Box<dyn Future<Output = GoogleCloudKmsResult<Vec<u8>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn sign_hash_evm<'life0, 'life1, 'async_trait>(
        &'life0 self,
        hash: &'life1 [u8; 32],
    ) -> Pin<Box<dyn Future<Output = GoogleCloudKmsResult<Vec<u8>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}

Required Methods§

Source

fn get_evm_address<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = GoogleCloudKmsResult<Address>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Returns the EVM address derived from the configured public key.

Source

fn sign_payload_evm<'life0, 'life1, 'async_trait>( &'life0 self, payload: &'life1 [u8], ) -> Pin<Box<dyn Future<Output = GoogleCloudKmsResult<Vec<u8>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Signs a payload using the EVM signing scheme (hashes before signing).

This method applies keccak256 hashing before signing.

Use for:

  • Raw transaction data (TxLegacy, TxEip1559)
  • EIP-191 personal messages

Note: For EIP-712 typed data, use sign_hash_evm() to avoid double-hashing.

Source

fn sign_hash_evm<'life0, 'life1, 'async_trait>( &'life0 self, hash: &'life1 [u8; 32], ) -> Pin<Box<dyn Future<Output = GoogleCloudKmsResult<Vec<u8>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Signs a pre-computed hash using the EVM signing scheme (no hashing).

This method signs the hash directly without applying keccak256.

Use for:

  • EIP-712 typed data (already hashed)
  • Pre-computed message digests

Note: For raw data, use sign_payload_evm() instead.

Implementors§