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
-
#address ⇒ Object
The Ethereum address corresponding to the signing key (0x-prefixed).
-
#sign(digest) ⇒ Object
Sign a 32-byte digest (raw binary).
-
#sign_hash(hash_bytes) ⇒ Object
Sign a 32-byte hash (raw binary bytes).
Instance Method Details
#address ⇒ Object
The Ethereum address corresponding to the signing key (0x-prefixed).
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).
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 |