multi: use key locator only for signing messages

To simplify the API surface of a remote signer even more, we refactor
the SignMessage and SignMessageCompact calls to only accept a key
locator as we always know what key we're using for signing anyway.
This commit is contained in:
Oliver Gugger
2021-09-23 16:54:29 +02:00
parent 8b7c88537c
commit afa03f22cc
6 changed files with 46 additions and 37 deletions

View File

@@ -192,15 +192,15 @@ type SecretKeyRing interface {
// signing on keys within a key ring.
type MessageSignerRing interface {
// SignMessage signs the given message, single or double SHA256 hashing
// it first, with the private key described in the key descriptor.
SignMessage(keyDesc KeyDescriptor, message []byte,
// it first, with the private key described in the key locator.
SignMessage(keyLoc KeyLocator, msg []byte,
doubleHash bool) (*btcec.Signature, error)
// SignMessageCompact signs the given message, single or double SHA256
// hashing it first, with the private key described in the key
// descriptor and returns the signature in the compact, public key
// recoverable format.
SignMessageCompact(keyDesc KeyDescriptor, message []byte,
// hashing it first, with the private key described in the key locator
// and returns the signature in the compact, public key recoverable
// format.
SignMessageCompact(keyLoc KeyLocator, msg []byte,
doubleHash bool) ([]byte, error)
}