security: Porting security elements to the updated framework
Change-Id: Ie9ad6ee34f94fc520b9d3c8adf871e2557eaa9b6
diff --git a/include/ndn-cpp/security/certificate/public-key.hpp b/include/ndn-cpp/security/certificate/public-key.hpp
index 43e1223..1fac1ec 100644
--- a/include/ndn-cpp/security/certificate/public-key.hpp
+++ b/include/ndn-cpp/security/certificate/public-key.hpp
@@ -33,13 +33,13 @@
*/
PublicKey(const uint8_t *keyDerBuf, size_t keyDerSize);
- const Buffer&
+ inline const Buffer&
get() const
{
return key_;
}
- void
+ inline void
set(const uint8_t *keyDerBuf, size_t keyDerSize)
{
Buffer buf(keyDerBuf, keyDerSize);
@@ -59,6 +59,18 @@
// Blob
// getDigest(DigestAlgorithm digestAlgorithm = DIGEST_ALGORITHM_SHA256) const;
+ inline bool
+ operator ==(const PublicKey &key) const
+ {
+ return key_ == key.key_;
+ }
+
+ inline bool
+ operator !=(const PublicKey &key) const
+ {
+ return key_ != key.key_;
+ }
+
private:
Buffer key_;
};