blob: 7d0faa435244d1093b8d5f2ed95a805f51fb4544 [file] [log] [blame]
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
/*
* Copyright (c) 2013, Regents of the University of California
* Yingdi Yu
*
* BSD license, See the LICENSE file for more information
*
* Author: Yingdi Yu <yingdi@cs.ucla.edu>
*/
#ifndef SYNC_INTRO_CERTIFICATE_H
#define SYNC_INTRO_CERTIFICATE_H
#include <ndn-cpp-dev/security/certificate.hpp>
#include <ndn-cpp-dev/security/identity-certificate.hpp>
class SyncIntroCertificate : public ndn::Certificate
{
public:
struct Error : public ndn::Certificate::Error { Error(const std::string &what) : ndn::Certificate::Error(what) {} };
enum IntroType{
PRODUCER,
INTRODUCER
};
public:
SyncIntroCertificate ();
SyncIntroCertificate (const ndn::Name& nameSpace,
const ndn::Name& keyName,
const ndn::Name& signerName,
const ndn::MillisecondsSince1970& notBefore,
const ndn::MillisecondsSince1970& notAfter,
const ndn::PublicKey& key,
const IntroType& introType = PRODUCER);
SyncIntroCertificate (const ndn::Name& nameSpace,
const ndn::IdentityCertificate& identityCertificate,
const ndn::Name& signerName,
const IntroType& introType);
SyncIntroCertificate (const ndn::Data& data);
SyncIntroCertificate (const SyncIntroCertificate& chronosIntroCertificate);
virtual
~SyncIntroCertificate ()
{}
ndn::Data&
setName (const ndn::Name& name);
inline virtual ndn::Name
getPublicKeyName () const
{ return m_keyName; }
inline IntroType
getIntroType()
{ return m_introType; }
static bool
isSyncIntroCertificate(const ndn::Certificate& certificate);
protected:
ndn::Name m_keyName;
IntroType m_introType;
};
#endif