NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.3: NDN, CCN, CCNx, content centric networks
API Documentation
pib-impl.hpp
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
22 #ifndef NDN_SECURITY_PIB_IMPL_HPP
23 #define NDN_SECURITY_PIB_IMPL_HPP
24 
25 #include <set>
27 
28 namespace ndn {
29 namespace security {
30 
37 class PibImpl
38 {
39 public:
46  class Error : public std::runtime_error
47  {
48  public:
49  explicit
50  Error(const std::string& what)
51  : std::runtime_error(what)
52  {
53  }
54  };
55 
56 public:
57 
58  virtual
60  {
61  }
62 
63 public: // TpmLocator management
64 
73  virtual void
74  setTpmLocator(const std::string& tpmLocator) = 0;
75 
79  virtual std::string
80  getTpmLocator() const = 0;
81 
82 public: // Identity management
83 
90  virtual bool
91  hasIdentity(const Name& identity) const = 0;
92 
101  virtual void
102  addIdentity(const Name& identity) = 0;
103 
112  virtual void
113  removeIdentity(const Name& identity) = 0;
114 
116  virtual std::set<Name>
117  getIdentities() const = 0;
118 
127  virtual void
128  setDefaultIdentity(const Name& identityName) = 0;
129 
136  virtual Name
137  getDefaultIdentity() const = 0;
138 
139 public: // Key management
140 
148  virtual bool
149  hasKey(const Name& identity, const name::Component& keyId) const = 0;
150 
163  virtual void
164  addKey(const Name& identity, const name::Component& keyId, const v1::PublicKey& publicKey) = 0;
165 
175  virtual void
176  removeKey(const Name& identity, const name::Component& keyId) = 0;
177 
186  virtual v1::PublicKey
187  getKeyBits(const Name& identity, const name::Component& keyId) const = 0;
188 
197  virtual std::set<name::Component>
198  getKeysOfIdentity(const Name& identity) const = 0;
199 
207  virtual void
208  setDefaultKeyOfIdentity(const Name& identity, const name::Component& keyId) = 0;
209 
216  virtual name::Component
217  getDefaultKeyOfIdentity(const Name& identity) const = 0;
218 
219 public: // Certificate Management
220 
227  virtual bool
228  hasCertificate(const Name& certName) const = 0;
229 
240  virtual void
241  addCertificate(const v1::IdentityCertificate& certificate) = 0;
242 
250  virtual void
251  removeCertificate(const Name& certName) = 0;
252 
261  getCertificate(const Name& certName) const = 0;
262 
273  virtual std::set<Name>
274  getCertificatesOfKey(const Name& identity, const name::Component& keyId) const = 0;
275 
284  virtual void
285  setDefaultCertificateOfKey(const Name& identity, const name::Component& keyId,
286  const Name& certName) = 0;
287 
297  getDefaultCertificateOfKey(const Name& identity, const name::Component& keyId) const = 0;
298 
299 };
300 
301 } // namespace security
302 } // namespace ndn
303 
304 #endif // NDN_SECURITY_PIB_IMPL_HPP
virtual void removeKey(const Name &identity, const name::Component &keyId)=0
Remove a key.
represents a non-semantic error
Definition: pib-impl.hpp:46
Copyright (c) 2011-2015 Regents of the University of California.
virtual bool hasIdentity(const Name &identity) const =0
Check the existence of an identity.
virtual void removeCertificate(const Name &certName)=0
Remove a certificate with name certName.
virtual bool hasKey(const Name &identity, const name::Component &keyId) const =0
Check the existence of a key.
virtual v1::PublicKey getKeyBits(const Name &identity, const name::Component &keyId) const =0
Get the key bits of a key.
virtual name::Component getDefaultKeyOfIdentity(const Name &identity) const =0
Get the id of the default key of an identity with name identity.
virtual std::string getTpmLocator() const =0
Get TPM Locator.
STL namespace.
virtual Name getDefaultIdentity() const =0
Get the default identity.
virtual void addIdentity(const Name &identity)=0
Add an identity.
virtual v1::IdentityCertificate getCertificate(const Name &certName) const =0
Get a certificate with name certName.
Error(const std::string &what)
Definition: pib-impl.hpp:50
virtual v1::IdentityCertificate getDefaultCertificateOfKey(const Name &identity, const name::Component &keyId) const =0
Get the default certificate of a key with id keyId of identity.
virtual std::set< Name > getCertificatesOfKey(const Name &identity, const name::Component &keyId) const =0
Get a list of certificate names of a key with id keyId of identity.
Name abstraction to represent an absolute name.
Definition: name.hpp:46
Abstract class of PIB implementation.
Definition: pib-impl.hpp:37
virtual void addKey(const Name &identity, const name::Component &keyId, const v1::PublicKey &publicKey)=0
Add a key.
virtual void setDefaultKeyOfIdentity(const Name &identity, const name::Component &keyId)=0
Set an key with id keyId as the default key of an identity with name identity.
Component holds a read-only name component value.
virtual void setDefaultCertificateOfKey(const Name &identity, const name::Component &keyId, const Name &certName)=0
Set a cert with name certName as the default of a key with id keyId of identity.
virtual std::set< Name > getIdentities() const =0
Get the name of all the identities.
virtual void addCertificate(const v1::IdentityCertificate &certificate)=0
Add a certificate.
virtual std::set< name::Component > getKeysOfIdentity(const Name &identity) const =0
Get all the key ids of an identity with name identity.
virtual void setTpmLocator(const std::string &tpmLocator)=0
Set the corresponding TPM information to tpmLocator.
virtual bool hasCertificate(const Name &certName) const =0
Check the existence of a certificate with name certName.
virtual void removeIdentity(const Name &identity)=0
Remove an identity.
virtual void setDefaultIdentity(const Name &identityName)=0
Set an identity with name identityName as the default identity.