All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
certificate-subject-description.hpp
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
9 #ifndef NDN_SECURITY_CERTIFICATE_SUBJECT_DESCRIPTION_HPP
10 #define NDN_SECURITY_CERTIFICATE_SUBJECT_DESCRIPTION_HPP
11 
12 #include "../common.hpp"
13 #include "../encoding/oid.hpp"
14 
15 namespace CryptoPP {
16 class BufferedTransformation;
17 }
18 
19 namespace ndn {
20 
25 {
26 public:
27  CertificateSubjectDescription(CryptoPP::BufferedTransformation& in)
28  {
29  decode(in);
30  }
31 
37  CertificateSubjectDescription(const OID& oid, const std::string& value)
38  : m_oid(oid), m_value(value)
39  {
40  }
41 
42  void
43  encode(CryptoPP::BufferedTransformation& out) const;
44 
45  void
46  decode(CryptoPP::BufferedTransformation& in);
47 
48  std::string
49  getOidString() const
50  {
51  return m_oid.toString();
52  }
53 
54  const std::string&
55  getValue() const
56  {
57  return m_value;
58  }
59 
60 private:
61  OID m_oid;
62  std::string m_value;
63 };
64 
65 } // namespace ndn
66 
67 #endif //NDN_SECURITY_CERTIFICATE_SUBJECT_DESCRIPTION_HPP
std::string toString() const
Definition: oid.cpp:50
void encode(CryptoPP::BufferedTransformation &out) const
A CertificateSubjectDescription represents the SubjectDescription entry in a Certificate.
CertificateSubjectDescription(CryptoPP::BufferedTransformation &in)
Definition: oid.hpp:20
void decode(CryptoPP::BufferedTransformation &in)
CertificateSubjectDescription(const OID &oid, const std::string &value)
Create a new CertificateSubjectDescription.