limal-ca-mgm
DNObject.hpp
Go to the documentation of this file.
1 /*---------------------------------------------------------------------\
2 | |
3 | _ _ _ _ __ _ |
4 | | | | | | \_/ | / \ | | |
5 | | | | | | |_| | / /\ \ | | |
6 | | |__ | | | | | | / ____ \ | |__ |
7 | |____||_| |_| |_|/ / \ \|____| |
8 | |
9 | ca-mgm library |
10 | |
11 | (C) SUSE Linux Products GmbH |
12 \----------------------------------------------------------------------/
13 
14  File: DNObject.hpp
15 
16  Author: <Michael Calmer> <mc@suse.de>
17  Maintainer: <Michael Calmer> <mc@suse.de>
18 
19  Purpose:
20 
21 /-*/
22 #ifndef LIMAL_CA_MGM_DN_OBJECT_HPP
23 #define LIMAL_CA_MGM_DN_OBJECT_HPP
24 
25 #include <limal/ca-mgm/config.h>
27 #include <blocxx/COWIntrusiveReference.hpp>
28 
29 namespace LIMAL_NAMESPACE {
30 
31 namespace CA_MGM_NAMESPACE {
32 
33  class CAConfig;
34  class RDNObjectImpl;
35  class DNObjectImpl;
36 
37  class RDNObject {
38  public:
39  RDNObject();
40  RDNObject(const RDNObject& rdn);
41  virtual ~RDNObject();
42 
43 #ifndef SWIG
44 
45  RDNObject& operator=(const RDNObject& rdn);
46 
47 #endif
48  void setRDNValue(const String& value);
49 
50  String getType() const;
51  String getValue() const;
52 
53  String getOpenSSLValue() const;
54 
55  virtual bool valid() const;
56  virtual blocxx::StringArray verify() const;
57 
58  virtual blocxx::StringArray dump() const;
59 
60 #ifndef SWIG
61 
62  friend bool operator==(const RDNObject &l, const RDNObject &r);
63  friend bool operator<(const RDNObject &l, const RDNObject &r);
64 
65 #endif
66 
67  protected:
68  blocxx::COWIntrusiveReference<RDNObjectImpl> m_impl;
69 
70  };
71 
72  class DNObject {
73  public:
74  DNObject();
75  DNObject(CAConfig* caConfig, Type type);
76  DNObject(const blocxx::List<RDNObject> &dn);
77  DNObject(const DNObject& dn);
78  virtual ~DNObject();
79 
80 #ifndef SWIG
81 
82  DNObject& operator=(const DNObject& dn);
83 
84 #endif
85 
86  void setDN(const blocxx::List<RDNObject> &dn);
87  blocxx::List<RDNObject> getDN() const;
88 
89  String getOpenSSLString() const;
90 
91  virtual bool valid() const;
92  virtual blocxx::StringArray verify() const;
93 
94  virtual blocxx::StringArray dump() const;
95 
96  protected:
97  blocxx::COWIntrusiveReference<DNObjectImpl> m_impl;
98 
99  private:
100  blocxx::StringArray
101  checkRDNList(const blocxx::List<RDNObject>& list) const;
102  };
103 
104 }
105 }
106 
107 #endif // LIMAL_CA_MGM_DN_OBJECT_HPP