Skip to main content

agent_sign_with_handle

Function agent_sign_with_handle 

Source
pub fn agent_sign_with_handle(
    handle: &AgentHandle,
    pubkey: &[u8],
    data: &[u8],
) -> Result<Vec<u8>, AgentError>
Expand description

Signs a message using a key currently loaded in the specified agent handle.

This retrieves the decrypted key material from the agent handle based on the provided public key bytes and performs the signing operation. It does not require a passphrase as the key is assumed to be already unlocked.

§Arguments

  • handle - The agent handle containing the loaded keys
  • pubkey: The public key bytes of the key to use for signing.
  • data: The data bytes to sign.

§Returns

The raw signature bytes, or an AgentError if the key is not found in the agent core or if the signing operation fails internally.