summaryrefslogtreecommitdiff
path: root/src/pubkey.h
diff options
context:
space:
mode:
authorRoman Smrž <roman.smrz@seznam.cz>2020-07-29 22:37:37 +0200
committerRoman Smrž <roman.smrz@seznam.cz>2020-07-29 22:37:37 +0200
commitd785003e9979068acc40a679f6470bd28f38fa01 (patch)
treed529b0f24bcf13c387a7e04640135ca3f3e50449 /src/pubkey.h
parent90021e1d335efac1017562c1d5dee43e99580319 (diff)
Add owner signature for owned identity
This signature is required and verified, but was not properly added by the builder on commit.
Diffstat (limited to 'src/pubkey.h')
-rw-r--r--src/pubkey.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/pubkey.h b/src/pubkey.h
index 7b80752..ef7e322 100644
--- a/src/pubkey.h
+++ b/src/pubkey.h
@@ -38,6 +38,8 @@ public:
template<class T>
Stored<Signed<T>> sign(const Stored<T> &) const;
+ template<class T>
+ Stored<Signed<T>> signAdd(const Stored<Signed<T>> &) const;
private:
vector<uint8_t> sign(const Digest &) const;
@@ -89,6 +91,16 @@ Stored<Signed<T>> SecretKey::sign(const Stored<T> & val) const
return st.store(Signed(val, { sig }));
}
+template<class T>
+Stored<Signed<T>> SecretKey::signAdd(const Stored<Signed<T>> & val) const
+{
+ auto st = val.ref().storage();
+ auto sig = st.store(Signature(pub(), sign(val.ref().digest())));
+ auto sigs = val->sigs;
+ sigs.push_back(st.store(Signature(pub(), sign(val->data.ref().digest()))));
+ return st.store(Signed(val->data, sigs));
+}
+
template<typename T>
Signed<T> Signed<T>::load(const Ref & ref)
{