aboutsummaryrefslogtreecommitdiff
path: root/objects
diff options
context:
space:
mode:
Diffstat (limited to 'objects')
-rw-r--r--objects/object_snapshot.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/objects/object_snapshot.go b/objects/object_snapshot.go
index 59c7121..7edbc2a 100644
--- a/objects/object_snapshot.go
+++ b/objects/object_snapshot.go
@@ -62,6 +62,14 @@ func (s Snapshot) Payload() (out []byte) {
return out
}
+type Signer interface {
+ Sign([]byte) ([]byte, error)
+}
+
+func (s Snapshot) SignedPayload(signer Signer) ([]byte, error) {
+ return signer.Sign(s.Payload())
+}
+
func (s *Snapshot) FromPayload(payload []byte) error {
r := bytes.NewBuffer(payload)