security: Correct KeyChain::addCertificate semantics
The documentation of KeyChain::addCertificate was ambiguous. On the one
hand, it stated that the certificate with the same name will be
overwritten. On the other hand, it stated that it will thrown an
exception if certificate with the same name exists. This commit ensures
the former behavior, which is consistent with the old KeyChain.
Change-Id: I911f7c86c634caf260ecb9a5dbdf13b066f8711f
diff --git a/src/security/pib/identity.hpp b/src/security/pib/identity.hpp
index 2bb1706..cc46bfd 100644
--- a/src/security/pib/identity.hpp
+++ b/src/security/pib/identity.hpp
@@ -113,7 +113,8 @@
* @brief Add a @p key of @p keyLen bytes (in PKCS#8 format) with @p keyName.
* @return the handle of added key
* @throw std::invalid_argument key name does not match identity
- * @throw Pib::Error a key with the same name already exists
+ *
+ * If a key with the same name already exists, overwrite the key.
*/
Key
addKey(const uint8_t* key, size_t keyLen, const Name& keyName) const;