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/certificate-extension.hpp b/src/security/certificate-extension.hpp
index 4eba4f2..1388107 100644
--- a/src/security/certificate-extension.hpp
+++ b/src/security/certificate-extension.hpp
@@ -23,9 +23,17 @@
class CertificateExtension
{
public:
- struct Error : public std::runtime_error { Error(const std::string &what) : std::runtime_error(what) {} };
+ class Error : public std::runtime_error
+ {
+ public:
+ explicit
+ Error(const std::string& what)
+ : std::runtime_error(what)
+ {
+ }
+ };
- CertificateExtension(CryptoPP::BufferedTransformation &in)
+ CertificateExtension(CryptoPP::BufferedTransformation& in)
{
decode(in);
}
@@ -45,7 +53,7 @@
: extensionId_(oid), isCritical_(isCritical), extensionValue_(value, valueSize)
{
}
-
+
/**
* The virtual destructor.
*/
@@ -53,20 +61,20 @@
~CertificateExtension() {}
void
- encode(CryptoPP::BufferedTransformation &out) const;
+ encode(CryptoPP::BufferedTransformation& out) const;
void
- decode(CryptoPP::BufferedTransformation &in);
-
- inline const OID&
+ decode(CryptoPP::BufferedTransformation& in);
+
+ inline const OID&
getOid() const { return extensionId_; }
- inline const bool
+ inline const bool
getIsCritical() const { return isCritical_; }
- inline const Buffer&
+ inline const Buffer&
getValue() const { return extensionValue_; }
-
+
protected:
OID extensionId_;
bool isCritical_;