src: Improving consistency and correcting code style

As of this commit, all data structures can be directly constructed from
wire format.

This commit excludes full correction of code style in security/ and
tools/ndnsec*, which will be part of a different commit.

Change-Id: I121ac1f81948bc7468990df52cdefeb2988d91a1
Refs: #1403
diff --git a/src/security/sec-tpm-file.hpp b/src/security/sec-tpm-file.hpp
index 8a108c5..fc1e410 100644
--- a/src/security/sec-tpm-file.hpp
+++ b/src/security/sec-tpm-file.hpp
@@ -18,9 +18,17 @@
 class SecTpmFile : public SecTpm
 {
 public:
-  struct Error : public SecTpm::Error { Error(const std::string &what) : SecTpm::Error(what) {} };
+  class Error : public SecTpm::Error
+  {
+  public:
+    explicit
+    Error(const std::string& what)
+      : SecTpm::Error(what)
+    {
+    }
+  };
 
-  SecTpmFile(const std::string & dir = "");
+  SecTpmFile(const std::string& dir = "");
 
   virtual
   ~SecTpmFile() {};
@@ -58,24 +66,24 @@
   }
 
   virtual void
-  generateKeyPairInTpm(const Name & keyName, KeyType keyType, int keySize);
+  generateKeyPairInTpm(const Name& keyName, KeyType keyType, int keySize);
 
   virtual void
-  deleteKeyPairInTpm(const Name &keyName);
+  deleteKeyPairInTpm(const Name& keyName);
 
   virtual shared_ptr<PublicKey>
-  getPublicKeyFromTpm(const Name & keyName);
+  getPublicKeyFromTpm(const Name&  keyName);
 
   virtual Block
-  signInTpm(const uint8_t *data, size_t dataLength, const Name& keyName, DigestAlgorithm digestAlgorithm);
+  signInTpm(const uint8_t* data, size_t dataLength, const Name& keyName, DigestAlgorithm digestAlgorithm);
 
-  virtual ConstBufferPtr 
+  virtual ConstBufferPtr
   decryptInTpm(const uint8_t* data, size_t dataLength, const Name& keyName, bool isSymmetric);
 
   virtual ConstBufferPtr
   encryptInTpm(const uint8_t* data, size_t dataLength, const Name& keyName, bool isSymmetric);
 
-  virtual void 
+  virtual void
   generateSymmetricKeyInTpm(const Name& keyName, KeyType keyType, int keySize);
 
   virtual bool
@@ -84,7 +92,7 @@
   virtual bool
   generateRandomBlock(uint8_t* res, size_t size);
 
-  virtual void 
+  virtual void
   addAppToACL(const Name& keyName, KeyClass keyClass, const std::string& appPath, AclType acl)
   {}
 
@@ -97,7 +105,7 @@
 
   virtual bool
   importPrivateKeyPkcs1IntoTpm(const Name& keyName, const uint8_t* buf, size_t size);
-  
+
   virtual bool
   importPublicKeyPkcs1IntoTpm(const Name& keyName, const uint8_t* buf, size_t size);