common.hpp: time: Added typedef for Milliseconds and MillisecondsSince1970, and use instead of double where appropriate.
diff --git a/ndn-cpp/security/certificate/certificate.cpp b/ndn-cpp/security/certificate/certificate.cpp
index 9a01424..a1acfbf 100644
--- a/ndn-cpp/security/certificate/certificate.cpp
+++ b/ndn-cpp/security/certificate/certificate.cpp
@@ -45,7 +45,7 @@
bool
Certificate::isTooEarly()
{
- Time now = ndn_getNowMilliseconds();
+ MillisecondsSince1970 now = ndn_getNowMilliseconds();
if(now < notBefore_)
return true;
else
@@ -55,7 +55,7 @@
bool
Certificate::isTooLate()
{
- Time now = ndn_getNowMilliseconds();
+ MillisecondsSince1970 now = ndn_getNowMilliseconds();
if(now > notAfter_)
return true;
else
diff --git a/ndn-cpp/security/identity/identity-manager.cpp b/ndn-cpp/security/identity/identity-manager.cpp
index f5b4657..c5a7793 100644
--- a/ndn-cpp/security/identity/identity-manager.cpp
+++ b/ndn-cpp/security/identity/identity-manager.cpp
@@ -82,7 +82,7 @@
}
Name
-IdentityManager::createIdentityCertificate(const Name& keyName, const Name& signerCertificateName, const Time& notBefore, const Time& notAfter)
+IdentityManager::createIdentityCertificate(const Name& keyName, const Name& signerCertificateName, const MillisecondsSince1970& notBefore, const MillisecondsSince1970& notAfter)
{
Blob keyBlob = identityStorage_->getKey(keyName);
shared_ptr<PublicKey> publicKey = PublicKey::fromDer(keyBlob);
@@ -97,7 +97,7 @@
ptr_lib::shared_ptr<IdentityCertificate>
IdentityManager::createIdentityCertificate
- (const Name& keyName, const PublicKey& publicKey, const Name& signerCertificateName, const Time& notBefore, const Time& notAfter)
+ (const Name& keyName, const PublicKey& publicKey, const Name& signerCertificateName, const MillisecondsSince1970& notBefore, const MillisecondsSince1970& notAfter)
{
#if 0
shared_ptr<IdentityCertificate> certificate(new IdentityCertificate());
@@ -236,9 +236,9 @@
current.tm_hour = 0;
current.tm_min = 0;
current.tm_sec = 0;
- Time notBefore = boost::posix_time::ptime_from_tm(current);
+ MillisecondsSince1970 notBefore = boost::posix_time::ptime_from_tm(current);
current.tm_year = current.tm_year + 20;
- Time notAfter = boost::posix_time::ptime_from_tm(current);
+ MillisecondsSince1970 notAfter = boost::posix_time::ptime_from_tm(current);
certificate->setNotBefore(notBefore);
certificate->setNotAfter(notAfter);