security: Introduce unsetKeyLocator method into SignatureInfo and Signature
Some specific signature types also provide an advisory (non-virtual)
override for unsetKeyLocator that disables reset and throws an
Exception. As before, if an application really wants, it still can
unset the KeyLocator by setting a new SignatureInfo without the
KeyLocator.
Change-Id: Ibefd5f9ffbcb91f8a83e76db8704cba1b984f914
Refs: #1750
diff --git a/src/signature.hpp b/src/signature.hpp
index 66a3f52..c2cb8c2 100644
--- a/src/signature.hpp
+++ b/src/signature.hpp
@@ -130,6 +130,18 @@
m_info.setKeyLocator(keyLocator);
}
+ /**
+ * @brief Unset KeyLocator
+ *
+ * Note that specific signature types may provide advisory (non-virtual) override
+ * to prevent unsetting KeyLocator if it is required by the specification.
+ */
+ void
+ unsetKeyLocator()
+ {
+ m_info.unsetKeyLocator();
+ }
+
public: // EqualityComparable concept
bool
operator==(const Signature& other) const