security: Porting security elements to the updated framework
Change-Id: Ie9ad6ee34f94fc520b9d3c8adf871e2557eaa9b6
diff --git a/include/ndn-cpp/security/certificate/identity-certificate.hpp b/include/ndn-cpp/security/certificate/identity-certificate.hpp
index 4d3a9db..85c8e72 100644
--- a/include/ndn-cpp/security/certificate/identity-certificate.hpp
+++ b/include/ndn-cpp/security/certificate/identity-certificate.hpp
@@ -16,12 +16,13 @@
class IdentityCertificate : public Certificate
{
public:
+ struct Error : public std::runtime_error { Error(const std::string &what) : std::runtime_error(what) {} };
+
/**
* The default constructor.
*/
- IdentityCertificate()
- {
- }
+ inline
+ IdentityCertificate();
// Note: The copy constructor works because publicKeyName_ has a copy constructor.
@@ -29,29 +30,20 @@
* Create an IdentityCertificate from the content in the data packet.
* @param data The data packet with the content to decode.
*/
+ inline
IdentityCertificate(const Data& data);
/**
- * The copy constructor.
- */
- IdentityCertificate(const IdentityCertificate& identityCertificate);
-
- /**
* The virtual destructor.
*/
- virtual
+ inline virtual
~IdentityCertificate();
- /**
- * Override the base class method to check that the name is a valid identity certificate name.
- * @param name The identity certificate name which is copied.
- * @return This Data so that you can chain calls to update values.
- */
- virtual Data &
- setName(const Name& name);
-
- Name
- getPublicKeyName () const { return publicKeyName_; }
+ inline void
+ wireDecode(const Block &wire);
+
+ inline const Name &
+ getPublicKeyName () const;
static bool
isIdentityCertificate(const Certificate& certificate);
@@ -75,6 +67,36 @@
Name publicKeyName_;
};
+inline
+IdentityCertificate::IdentityCertificate()
+{
+}
+
+inline
+IdentityCertificate::IdentityCertificate(const Data& data)
+ : Certificate(data)
+{
+ setPublicKeyName();
+}
+
+inline
+IdentityCertificate::~IdentityCertificate()
+{
+}
+
+inline void
+IdentityCertificate::wireDecode(const Block &wire)
+{
+ Certificate::wireDecode(wire);
+ setPublicKeyName();
+}
+
+inline const Name &
+IdentityCertificate::getPublicKeyName () const
+{
+ return publicKeyName_;
+}
+
}
#endif