identity-certificate.hpp
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
24 #ifndef NDN_SECURITY_V1_IDENTITY_CERTIFICATE_HPP
25 #define NDN_SECURITY_V1_IDENTITY_CERTIFICATE_HPP
26 
27 #include "../../common.hpp"
28 #include "certificate.hpp"
29 
30 namespace ndn {
31 namespace security {
32 namespace v1 {
33 
35 {
36 public:
37  class Error : public Certificate::Error
38  {
39  public:
40  explicit
41  Error(const std::string& what)
42  : Certificate::Error(what)
43  {
44  }
45  };
46 
51 
56  explicit
57  IdentityCertificate(const Data& data);
58 
63  explicit
64  IdentityCertificate(const Block& block);
65 
66  void
67  wireDecode(const Block& wire);
68 
69  void
70  setName(const Name& name);
71 
72  const Name&
74  {
75  return m_publicKeyName;
76  }
77 
78  static bool
79  isIdentityCertificate(const Certificate& certificate);
80 
86  static Name
87  certificateNameToPublicKeyName(const Name& certificateName);
88 
89 private:
90  static bool
91  isCorrectName(const Name& name);
92 
93  void
94  setPublicKeyName();
95 
96 protected:
98 };
99 
100 } // namespace v1
101 } // namespace security
102 
103 #ifdef NDN_CXX_KEEP_SECURITY_V1_ALIASES
106 #endif // NDN_CXX_KEEP_SECURITY_V1_ALIASES
107 
108 } // namespace ndn
109 
110 #endif // NDN_SECURITY_V1_IDENTITY_CERTIFICATE_HPP
static Name certificateNameToPublicKeyName(const Name &certificateName)
Get the public key name from the full certificate name.
Copyright (c) 2013-2017 Regents of the University of California.
Definition: common.hpp:75
Represents a TLV element of NDN packet format.
Definition: block.hpp:42
IdentityCertificate()
The default constructor.
static bool isIdentityCertificate(const Certificate &certificate)
Represents an absolute name.
Definition: name.hpp:42
Represents a Data packet.
Definition: data.hpp:35