Module: Remitmd::Signer

Included in:
CliSigner, MockSigner, PrivateKeySigner
Defined in:
lib/remitmd/signer.rb

Overview

Interface for signing remit.md API requests. Implement this module to provide custom signing (HSM, KMS, etc.).

Instance Method Summary collapse

Instance Method Details

#addressObject

The Ethereum address corresponding to the signing key (0x-prefixed).

Raises:

  • (NotImplementedError)


33
34
35
# File 'lib/remitmd/signer.rb', line 33

def address
  raise NotImplementedError, "#{self.class}#address is not implemented"
end

#sign(digest) ⇒ Object

Sign a 32-byte digest (raw binary). Returns 65-byte hex (r||s||v, Ethereum style).

Raises:

  • (NotImplementedError)


22
23
24
# File 'lib/remitmd/signer.rb', line 22

def sign(digest)
  raise NotImplementedError, "#{self.class}#sign is not implemented"
end

#sign_hash(hash_bytes) ⇒ Object

Sign a 32-byte hash (raw binary bytes). Returns 0x-prefixed 65-byte hex signature. Used by /permits/prepare and /x402/prepare flows.



28
29
30
# File 'lib/remitmd/signer.rb', line 28

def sign_hash(hash_bytes)
  sign(hash_bytes)
end