Add x509 utils

This change moves some existing static functions in the Certificate
class and x509 related routines into a separate library. These functions
will be used in future Authorities List related functions.

This change also reduces the number of times Certificate class reads PEM
files by passing cert via X509 pointers rather than Certificate paths.

Signed-off-by: Nan Zhou <nanzhoumails@gmail.com>
Change-Id: Ieb268ee051c3597f2add732902eb0461375a4c3f
diff --git a/certificate.hpp b/certificate.hpp
index c96017f..fa3191a 100644
--- a/certificate.hpp
+++ b/certificate.hpp
@@ -146,31 +146,14 @@
 
   private:
     /**
-     * @brief Return error if ceritificate NotBefore date is lt 1970
+     * @brief Populate certificate properties by parsing given certificate
+     * object
      *
-     * Parse the certificate and return error if certificate NotBefore date
-     * is lt 1970.
-     *
-     * @param[in] cert  Reference to certificate object uploaded
+     * @param[in] cert The given certificate object
      *
      * @return void
      */
-    void validateCertificateStartDate(X509& cert);
-
-    /**
-     * @brief Populate certificate properties by parsing given certificate file
-     *
-     * @param[in] certPath   Path to certificate that should be parsed
-     *
-     * @return void
-     */
-    void populateProperties(const std::string& certPath);
-
-    /** @brief Load Certificate file into the X509 structure.
-     *  @param[in] filePath - Certificate and key full file path.
-     *  @return pointer to the X509 structure.
-     */
-    internal::X509Ptr loadCert(const std::string& filePath);
+    void populateProperties(X509& cert);
 
     /** @brief Check and append private key to the certificate file
      *         If private key is not present in the certificate file append the
@@ -190,15 +173,6 @@
     bool compareKeys(const std::string& filePath);
 
     /**
-     * @brief Generate certificate ID based on provided certificate file.
-     *
-     * @param[in] certPath - Certificate file path.
-     *
-     * @return Certificate ID as formatted string.
-     */
-    std::string generateCertId(const std::string& certPath);
-
-    /**
      * @brief Generate file name which is unique in the provided directory.
      *
      * @param[in] directoryPath - Directory path.