blob: 28202dad340a5ed28d5e533271391d75efa7bb77 [file] [log] [blame]
Yingdi Yu3c2a9762013-10-11 11:02:09 -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 LINKEDN_ENDORSE_CERTIFICATE_H
12#define LINKEDN_ENDORSE_CERTIFICATE_H
13
14#include <vector>
15#include <ndn.cxx/data.h>
16#include <ndn.cxx/security/certificate/identity-certificate.h>
17#include <ndn.cxx/security/certificate/certificate-extension.h>
18
19#include "profile-data.h"
20
21class EndorseExtension : public ndn::security::CertificateExtension
22{
23public:
24 EndorseExtension(const ndn::Blob & value);
25
26 virtual
27 ~EndorseExtension() {}
28};
29
30class EndorseCertificate : public ndn::security::Certificate
31{
32public:
33 EndorseCertificate(const ndn::security::IdentityCertificate& kskCertificate,
34 const ndn::Name& signer,
35 const ndn::Time& notBefore,
36 const ndn::Time& notAfter);
37
38 EndorseCertificate(const EndorseCertificate& endorseCertificate);
39
40 EndorseCertificate(const ndn::Data& data);
41
42 virtual
43 ~EndorseCertificate()
44 {}
45
46 void
47 addProfile(const ProfileData& profile);
48
49 void
50 encode();
51
52 inline const ndn::Name&
53 getSigner() const
54 { return m_signer; }
55
56 inline const std::vector<ProfileData>&
57 getProfileList() const
58 { return m_profileList; }
59
60 inline ndn::Name
61 getPublicKeyName ()
62 { return m_keyName; }
63
64private:
65 void
66 decode();
67
68private:
69 ndn::Name m_keyName;
70 ndn::Name m_signer;
71 std::vector<ProfileData> m_profileList;
72};
73
74#endif