security: get KeyDigest from PublicKey.
Change-Id: Ibb7cf0aba262dbb80d5ea1d2da02318963c0f417
Refs: #1964
diff --git a/src/security/public-key.hpp b/src/security/public-key.hpp
index 243bccc..e739717 100644
--- a/src/security/public-key.hpp
+++ b/src/security/public-key.hpp
@@ -29,6 +29,7 @@
#include "../common.hpp"
#include "../encoding/buffer.hpp"
+#include "../encoding/block.hpp"
#include "security-common.hpp"
namespace CryptoPP {
@@ -84,6 +85,12 @@
return m_type;
}
+ /**
+ * @return a KeyDigest block that matches this public key
+ */
+ const Block&
+ computeDigest() const;
+
void
encode(CryptoPP::BufferedTransformation& out) const;
@@ -105,6 +112,7 @@
private:
KeyType m_type;
Buffer m_key;
+ mutable Block m_digest;
};
std::ostream&