OpenDDS  Snapshot(2023/04/28-20:55)
SubjectName.h
Go to the documentation of this file.
1 /*
2  * Distributed under the OpenDDS License.
3  * See: http://www.OpenDDS.org/license.html
4  */
5 
6 #ifndef OPENDDS_DCPS_SECURITY_SSL_SUBJECTNAME_H
7 #define OPENDDS_DCPS_SECURITY_SSL_SUBJECTNAME_H
8 
11 
12 #include <string>
13 #include <map>
14 
16 
17 namespace OpenDDS {
18 namespace Security {
19 namespace SSL {
20 
22  private:
23  typedef std::map<std::string, std::string> AttrMap;
24 
25 public:
26  SubjectName();
27  explicit SubjectName(const char*, bool permissive = false);
28  explicit SubjectName(const std::string&, bool permissive = false);
29 
30  /**
31  * @return int 0 on success; 1 on failure.
32  */
33  int parse(const char*, bool permissive = false);
34 
35  /**
36  * @return int 0 on success; 1 on failure.
37  */
38  int parse(const std::string&, bool permissive = false);
39 
40  bool operator==(const SubjectName&) const;
41  bool operator!=(const SubjectName&) const;
42 
43  typedef AttrMap::const_iterator const_iterator;
44  const_iterator begin() const { return map_.begin(); }
45  const_iterator end() const { return map_.end(); }
46  const_iterator find(const std::string& key) const { return map_.find(key); }
47 
48 private:
49  /**
50  * @return int 0 on success; 1 on failure.
51  */
52  int parse_permissive(const char*);
53 
54  /**
55  * @return int 0 on success; 1 on failure.
56  */
57  int parse_dce(const char*);
58 
59  /**
60  * @return int 0 on success; 1 on failure.
61  */
62  int parse_ldap_v3(const char*);
63 
64  int simple_avp_seq_parse(const char* in, const char* s_del,
65  const char* a_del, const char* s_trim,
66  const char* a_trim, bool push_back);
67 
68  AttrMap map_;
69 };
70 
71 } // namespace SSL
72 } // namespace Security
73 } // namespace OpenDDS
74 
76 
77 #endif
bool operator==(const Certificate &lhs, const Certificate &rhs)
sequence< octet > key
const_iterator begin() const
Definition: SubjectName.h:44
const_iterator find(const std::string &key) const
Definition: SubjectName.h:46
AttrMap::const_iterator const_iterator
Definition: SubjectName.h:43
const_iterator end() const
Definition: SubjectName.h:45
bool operator!=(const GUID_t &lhs, const GUID_t &rhs)
Definition: GuidUtils.h:125
#define OpenDDS_Security_Export
void push_back(Seq &seq, const typename Seq::value_type &val)
std::vector-style push_back() for CORBA Sequences
Definition: Util.h:138
std::map< std::string, std::string > AttrMap
Definition: SubjectName.h:23
#define OPENDDS_END_VERSIONED_NAMESPACE_DECL
The Internal API and Implementation of OpenDDS.
Definition: AddressCache.h:28