Yingdi Yu | 43e7161 | 2013-10-30 22:19:31 -0700 | [diff] [blame^] | 1 | /* -*- 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 | |
| 14 | #include <ndn.cxx/security/certificate/certificate.h> |
| 15 | #include <ndn.cxx/security/certificate/identity-certificate.h> |
| 16 | |
| 17 | class SyncIntroCertificate : public ndn::security::Certificate |
| 18 | { |
| 19 | public: |
| 20 | enum IntroType{ |
| 21 | PRODUCER, |
| 22 | INTRODUCER |
| 23 | }; |
| 24 | |
| 25 | public: |
| 26 | SyncIntroCertificate (); |
| 27 | |
| 28 | SyncIntroCertificate (const ndn::Name& nameSpace, |
| 29 | const ndn::Name& keyName, |
| 30 | const ndn::Name& signerName, |
| 31 | const ndn::Time& notBefore, |
| 32 | const ndn::Time& notAfter, |
| 33 | const ndn::security::Publickey& key, |
| 34 | const IntroType& introType = PRODUCER); |
| 35 | |
| 36 | SyncIntroCertificate (const ndn::Name& nameSpace, |
| 37 | const ndn::security::IdentityCertificate& identityCertificate, |
| 38 | 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 | |
| 50 | ndn::Data & |
| 51 | 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 |
| 62 | isSyncIntroCertificate(const ndn::security::Certificate& certificate); |
| 63 | |
| 64 | protected: |
| 65 | ndn::Name m_keyName; |
| 66 | IntroType m_introType; |
| 67 | }; |
| 68 | |
| 69 | #endif |