All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
identity-certificate.hpp
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
9 #ifndef NDN_SECURITY_IDENTITY_CERTIFICATE_HPP
10 #define NDN_SECURITY_IDENTITY_CERTIFICATE_HPP
11 
12 #include "../common.hpp"
13 #include "certificate.hpp"
14 
15 namespace ndn {
16 
18 {
19 public:
20  class Error : public std::runtime_error
21  {
22  public:
23  explicit
24  Error(const std::string& what)
25  : std::runtime_error(what)
26  {
27  }
28  };
29 
33  inline
35 
40  inline
41  IdentityCertificate(const Data& data);
42 
46  inline virtual
48 
49  inline void
50  wireDecode(const Block& wire);
51 
52  inline void
53  setName(const Name& name);
54 
55  inline const Name&
56  getPublicKeyName() const;
57 
58  static bool
59  isIdentityCertificate(const Certificate& certificate);
60 
66  static Name
67  certificateNameToPublicKeyName(const Name& certificateName);
68 
69 private:
70  static bool
71  isCorrectName(const Name& name);
72 
73  void
74  setPublicKeyName();
75 
76 protected:
78 };
79 
80 inline
82 {
83 }
84 
85 inline
87  : Certificate(data)
88 {
89  setPublicKeyName();
90 }
91 
92 inline
94 {
95 }
96 
97 inline void
99 {
101  setPublicKeyName();
102 }
103 
104 inline void
106 {
107  Certificate::setName(name);
108  setPublicKeyName();
109 }
110 
111 inline const Name&
113 {
114  return m_publicKeyName;
115 }
116 
117 } // namespace ndn
118 
119 #endif //NDN_SECURITY_IDENTITY_CERTIFICATE_HPP
void wireDecode(const Block &wire)
static Name certificateNameToPublicKeyName(const Name &certificateName)
Get the public key name from the full certificate name.
Class representing wire element of the NDN packet.
Definition: block.hpp:26
void wireDecode(const Block &wire)
IdentityCertificate()
The default constructor.
void setName(const Name &name)
static bool isIdentityCertificate(const Certificate &certificate)
A Name holds an array of Name::Component and represents an NDN name.
Definition: name.hpp:26
const Name & getPublicKeyName() const
void setName(const Name &name)
Set name to a copy of the given Name.
Definition: data.hpp:352
virtual ~IdentityCertificate()
The virtual destructor.