blob: cfc55964890c67347153bfbc099415ff1904db76 [file] [log] [blame]
Yingdi Yu43e71612013-10-30 22:19:31 -07001/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
2/*
3 * Copyright (c) 2013, Regents of the University of California
4 * Yingdi Yu
5 *
6 * BSD license, See the LICENSE file for more information
7 *
8 * Author: Yingdi Yu <yingdi@cs.ucla.edu>
9 */
10
11#ifndef SYNC_INTRO_CERTIFICATE_H
12#define SYNC_INTRO_CERTIFICATE_H
13
Yingdi Yu46c9f1a2013-12-18 15:15:46 +080014#include <ndn-cpp/security/certificate/certificate.hpp>
15#include <ndn-cpp/security/certificate/identity-certificate.hpp>
Yingdi Yu43e71612013-10-30 22:19:31 -070016
Yingdi Yu46c9f1a2013-12-18 15:15:46 +080017class SyncIntroCertificate : public ndn::Certificate
Yingdi Yu43e71612013-10-30 22:19:31 -070018{
19public:
20 enum IntroType{
21 PRODUCER,
22 INTRODUCER
23 };
24
25public:
26 SyncIntroCertificate ();
27
28 SyncIntroCertificate (const ndn::Name& nameSpace,
29 const ndn::Name& keyName,
30 const ndn::Name& signerName,
Yingdi Yu46c9f1a2013-12-18 15:15:46 +080031 const ndn::MillisecondsSince1970& notBefore,
32 const ndn::MillisecondsSince1970& notAfter,
33 const ndn::PublicKey& key,
Yingdi Yu43e71612013-10-30 22:19:31 -070034 const IntroType& introType = PRODUCER);
35
36 SyncIntroCertificate (const ndn::Name& nameSpace,
Yingdi Yu46c9f1a2013-12-18 15:15:46 +080037 const ndn::IdentityCertificate& identityCertificate,
Yingdi Yu43e71612013-10-30 22:19:31 -070038 const ndn::Name& signerName,
39 const IntroType& introType);
40
41 SyncIntroCertificate (const ndn::Data& data);
42
43 SyncIntroCertificate (const SyncIntroCertificate& chronosIntroCertificate);
44
45
46 virtual
47 ~SyncIntroCertificate ()
48 {}
49
Yingdi Yu46c9f1a2013-12-18 15:15:46 +080050 ndn::Data&
Yingdi Yu43e71612013-10-30 22:19:31 -070051 setName (const ndn::Name& name);
52
53 inline virtual ndn::Name
54 getPublicKeyName () const
55 { return m_keyName; }
56
57 inline IntroType
58 getIntroType()
59 { return m_introType; }
60
61 static bool
Yingdi Yu46c9f1a2013-12-18 15:15:46 +080062 isSyncIntroCertificate(const ndn::Certificate& certificate);
Yingdi Yu43e71612013-10-30 22:19:31 -070063
64protected:
65 ndn::Name m_keyName;
66 IntroType m_introType;
67};
68
69#endif