libcamgm
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 CA_MGM_DN_OBJECT_HPP
23 #define CA_MGM_DN_OBJECT_HPP
24 
25 #include <ca-mgm/config.h>
26 #include <ca-mgm/CommonData.hpp>
27 #include <ca-mgm/PtrTypes.hpp>
28 
29 namespace CA_MGM_NAMESPACE {
30 
31  class CAConfig;
32  class CA;
33  class RDNObjectImpl;
34  class DNObjectImpl;
35 
36  class RDNObject {
37  public:
38  RDNObject();
39  RDNObject(const RDNObject& rdn);
40  virtual ~RDNObject();
41 
42 #ifndef SWIG
43 
44  RDNObject& operator=(const RDNObject& rdn);
45 
46 #endif
47  void setRDNValue(const std::string& value);
48 
49  std::string getType() const;
50  std::string getOpenSSLType() const;
51  std::string getValue() const;
52 
53  std::string getOpenSSLValue() const;
54 
55  virtual bool valid() const;
56  virtual std::vector<std::string> verify() const;
57 
58  virtual std::vector<std::string> 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:
69 
70  };
71 
72  class DNObject {
73  public:
74  DNObject();
75  DNObject(CAConfig* caConfig, Type type);
76  DNObject(const std::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 std::list<RDNObject> &dn);
87  std::list<RDNObject> getDN() const;
88 
89  std::string getOpenSSLString() const;
90 
91  virtual bool valid() const;
92  virtual std::vector<std::string> verify() const;
93 
94  virtual std::vector<std::string> dump() const;
95 
96  virtual void commit2Config(CA& ca, Type type) const;
97 
98  protected:
100 
101  private:
102  std::vector<std::string>
103  checkRDNList(const std::list<RDNObject>& list) const;
104  };
105 
106 }
107 
108 #endif // CA_MGM_DN_OBJECT_HPP
Managing a CA repository.
Definition: CA.hpp:54
Definition: DNObject.hpp:72
Definition: CAConfig.hpp:43
ca_mgm::RWCOW_pointer< DNObjectImpl > m_impl
Definition: DNObject.hpp:99
Type
Definition: CommonData.hpp:39
Definition: DNObject.hpp:36
ca_mgm::RWCOW_pointer< RDNObjectImpl > m_impl
Definition: DNObject.hpp:68
bool operator==(const PathName &lname, const PathName &rname)
Definition: PathName.hpp:435